From owner-dev-commits-src-branches@freebsd.org Mon Jun 21 14:22:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 151CC64994A; Mon, 21 Jun 2021 14:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G7sDG0182z3jst; Mon, 21 Jun 2021 14:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCD7D1E964; Mon, 21 Jun 2021 14:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15LEM5fP058064; Mon, 21 Jun 2021 14:22:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15LEM5jt058063; Mon, 21 Jun 2021 14:22:05 GMT (envelope-from git) Date: Mon, 21 Jun 2021 14:22:05 GMT Message-Id: <202106211422.15LEM5jt058063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4a77ce73eadf - stable/13 - amd64: Fix propagation of LDT updates MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4a77ce73eadfe7ceddc3f2330028880b886401fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 14:22:06 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4a77ce73eadfe7ceddc3f2330028880b886401fd commit 4a77ce73eadfe7ceddc3f2330028880b886401fd Author: Mark Johnston AuthorDate: 2021-06-14 21:32:18 +0000 Commit: Mark Johnston CommitDate: 2021-06-21 13:13:20 +0000 amd64: Fix propagation of LDT updates When a process has used sysarch(2) to specify descriptors for its private LDT, upon rfork(RFMEM) descriptors are copied into the new child process. Any updates to the descriptors are thus reflected to all other processes sharing the vmspace. However, this is incorrect in the rather obscure case where the child process was created before the LDT was modified. Fix this by only modifying other processes which already share the LDT. Reported by: syzkaller Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 70dd5eebc025badb7b835dfee3915d8b5f1e7468) --- sys/amd64/amd64/sys_machdep.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 5a0145e76ccd..c10b15896132 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -492,15 +492,19 @@ set_user_ldt(struct mdproc *mdp) } static void -set_user_ldt_rv(struct vmspace *vmsp) +set_user_ldt_rv(void *arg) { - struct thread *td; + struct proc *orig, *target; + struct proc_ldt *ldt; + + orig = arg; + target = curthread->td_proc; - td = curthread; - if (vmsp != td->td_proc->p_vmspace) + ldt = (void *)atomic_load_acq_ptr((uintptr_t *)&orig->p_md.md_ldt); + if (target->p_md.md_ldt != ldt) return; - set_user_ldt(&td->td_proc->p_md); + set_user_ldt(&target->p_md); } struct proc_ldt * @@ -550,8 +554,7 @@ user_ldt_alloc(struct proc *p, int force) atomic_thread_fence_rel(); mdp->md_ldt = new_ldt; critical_exit(); - smp_rendezvous(NULL, (void (*)(void *))set_user_ldt_rv, NULL, - p->p_vmspace); + smp_rendezvous(NULL, set_user_ldt_rv, NULL, p); return (mdp->md_ldt); } From owner-dev-commits-src-branches@freebsd.org Mon Jun 21 14:22:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 8E5F764994F; Mon, 21 Jun 2021 14:22:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G7sDJ32Jtz3jbs; Mon, 21 Jun 2021 14:22:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40D691E66B; Mon, 21 Jun 2021 14:22:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15LEM8C3058112; Mon, 21 Jun 2021 14:22:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15LEM8HJ058111; Mon, 21 Jun 2021 14:22:08 GMT (envelope-from git) Date: Mon, 21 Jun 2021 14:22:08 GMT Message-Id: <202106211422.15LEM8HJ058111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d77e57f1256a - stable/13 - Consistently use the SOCKBUF_MTX() and SOCK_MTX() macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d77e57f1256ac06a50e06bb2a5dd7bd58ef2417a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 14:22:08 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d77e57f1256ac06a50e06bb2a5dd7bd58ef2417a commit d77e57f1256ac06a50e06bb2a5dd7bd58ef2417a Author: Mark Johnston AuthorDate: 2021-06-14 21:32:32 +0000 Commit: Mark Johnston CommitDate: 2021-06-21 13:14:48 +0000 Consistently use the SOCKBUF_MTX() and SOCK_MTX() macros This makes it easier to change the socket locking protocols. No functional change intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit a100217489405e5926230c50d97aa3f886df5385) --- sys/dev/iscsi/icl_soft.c | 2 +- sys/kern/uipc_sockbuf.c | 2 +- sys/kern/uipc_socket.c | 2 +- sys/netinet/sctputil.c | 6 +++--- sys/sys/socketvar.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 9cede6b44311..a48ad53d70d7 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -729,7 +729,7 @@ icl_receive_thread(void *arg) available = sbavail(&so->so_rcv); if (read + available < ic->ic_receive_len) { so->so_rcv.sb_lowat = ic->ic_receive_len - read; - cv_wait(&ic->ic_receive_cv, &so->so_rcv.sb_mtx); + cv_wait(&ic->ic_receive_cv, SOCKBUF_MTX(&so->so_rcv)); so->so_rcv.sb_lowat = so->so_rcv.sb_hiwat + 1; available = sbavail(&so->so_rcv); } diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index cf53f234d8fc..2c0e10ee1dc2 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -446,7 +446,7 @@ sbwait(struct sockbuf *sb) SOCKBUF_LOCK_ASSERT(sb); sb->sb_flags |= SB_WAIT; - return (msleep_sbt(&sb->sb_acc, &sb->sb_mtx, + return (msleep_sbt(&sb->sb_acc, SOCKBUF_MTX(sb), (sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK | PCATCH, "sbwait", sb->sb_timeo, 0, 0)); } diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 070ed440b500..9f8ad921933b 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1011,7 +1011,7 @@ solisten_dequeue(struct socket *head, struct socket **ret, int flags) while (!(head->so_state & SS_NBIO) && TAILQ_EMPTY(&head->sol_comp) && head->so_error == 0) { - error = msleep(&head->sol_comp, &head->so_lock, PSOCK | PCATCH, + error = msleep(&head->sol_comp, SOCK_MTX(head), PSOCK | PCATCH, "accept", 0); if (error != 0) { SOLISTEN_UNLOCK(head); diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 2c10ab158c83..82fc38b39ff7 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -376,9 +376,9 @@ sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from) } sctp_clog.x.lock.info_lock = rw_wowned(&SCTP_BASE_INFO(ipi_ep_mtx)); if (inp && (inp->sctp_socket)) { - sctp_clog.x.lock.sock_lock = mtx_owned(&(inp->sctp_socket->so_rcv.sb_mtx)); - sctp_clog.x.lock.sockrcvbuf_lock = mtx_owned(&(inp->sctp_socket->so_rcv.sb_mtx)); - sctp_clog.x.lock.socksndbuf_lock = mtx_owned(&(inp->sctp_socket->so_snd.sb_mtx)); + sctp_clog.x.lock.sock_lock = mtx_owned(SOCK_MTX(inp->sctp_socket)); + sctp_clog.x.lock.sockrcvbuf_lock = mtx_owned(SOCKBUF_MTX(&inp->sctp_socket->so_rcv)); + sctp_clog.x.lock.socksndbuf_lock = mtx_owned(SOCKBUF_MTX(&inp->sctp_socket->so_snd)); } else { sctp_clog.x.lock.sock_lock = SCTP_LOCK_UNKNOWN; sctp_clog.x.lock.sockrcvbuf_lock = SCTP_LOCK_UNKNOWN; diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 295a1cf3d37f..dbd9804a980d 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -218,7 +218,7 @@ struct socket { #ifdef _KERNEL -#define SOCK_MTX(so) &(so)->so_lock +#define SOCK_MTX(so) (&(so)->so_lock) #define SOCK_LOCK(so) mtx_lock(&(so)->so_lock) #define SOCK_OWNED(so) mtx_owned(&(so)->so_lock) #define SOCK_UNLOCK(so) mtx_unlock(&(so)->so_lock) From owner-dev-commits-src-branches@freebsd.org Mon Jun 21 14:22:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 5029064994E; Mon, 21 Jun 2021 14:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G7sDH1gMHz3jt2; Mon, 21 Jun 2021 14:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FBB21ECD2; Mon, 21 Jun 2021 14:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15LEM6RX058088; Mon, 21 Jun 2021 14:22:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15LEM6HZ058087; Mon, 21 Jun 2021 14:22:06 GMT (envelope-from git) Date: Mon, 21 Jun 2021 14:22:06 GMT Message-Id: <202106211422.15LEM6HZ058087@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 46d8116cae68 - stable/13 - Consistently use the SOLISTENING() macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 46d8116cae6845be70230640f16568576269b177 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 14:22:07 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=46d8116cae6845be70230640f16568576269b177 commit 46d8116cae6845be70230640f16568576269b177 Author: Mark Johnston AuthorDate: 2021-06-14 21:32:27 +0000 Commit: Mark Johnston CommitDate: 2021-06-21 13:14:40 +0000 Consistently use the SOLISTENING() macro Some code was using it already, but in many places we were testing SO_ACCEPTCONN directly. As a small step towards fixing some bugs involving synchronization with listen(2), make the kernel consistently use SOLISTENING(). No functional change intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit f4bb1869ddd2bca89b6b6bfaf4d866efdd9243cf) --- sys/dev/hyperv/hvsock/hv_sock.c | 2 +- sys/kern/uipc_accf.c | 7 +++---- sys/kern/uipc_socket.c | 8 ++++---- sys/kern/uipc_syscalls.c | 2 +- sys/kern/uipc_usrreq.c | 2 +- sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c | 3 +-- sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c | 3 +-- sys/netgraph/bluetooth/socket/ng_btsocket_sco.c | 2 +- sys/netinet/tcp_input.c | 7 +++---- sys/netinet/tcp_subr.c | 4 ++-- sys/rpc/svc_vc.c | 2 +- 11 files changed, 19 insertions(+), 23 deletions(-) diff --git a/sys/dev/hyperv/hvsock/hv_sock.c b/sys/dev/hyperv/hvsock/hv_sock.c index bcc237271465..00e296fcd335 100644 --- a/sys/dev/hyperv/hvsock/hv_sock.c +++ b/sys/dev/hyperv/hvsock/hv_sock.c @@ -1482,7 +1482,7 @@ hvsock_open_conn_passive(struct vmbus_channel *chan, struct socket *so, int error; /* Do nothing if socket is not listening */ - if ((so->so_options & SO_ACCEPTCONN) == 0) { + if (!SOLISTENING(so)) { HVSOCK_DBG(HVSOCK_DBG_ERR, "%s: socket is not a listening one\n", __func__); return; diff --git a/sys/kern/uipc_accf.c b/sys/kern/uipc_accf.c index 3ca64dd21e25..792c53c7baff 100644 --- a/sys/kern/uipc_accf.c +++ b/sys/kern/uipc_accf.c @@ -172,7 +172,7 @@ accept_filt_getopt(struct socket *so, struct sockopt *sopt) error = 0; afap = malloc(sizeof(*afap), M_TEMP, M_WAITOK | M_ZERO); SOCK_LOCK(so); - if ((so->so_options & SO_ACCEPTCONN) == 0) { + if (!SOLISTENING(so)) { error = EINVAL; goto out; } @@ -208,7 +208,7 @@ accept_filt_setopt(struct socket *so, struct sockopt *sopt) int wakeup; SOCK_LOCK(so); - if ((so->so_options & SO_ACCEPTCONN) == 0) { + if (!SOLISTENING(so)) { SOCK_UNLOCK(so); return (EINVAL); } @@ -278,8 +278,7 @@ accept_filt_setopt(struct socket *so, struct sockopt *sopt) * without first removing it. */ SOCK_LOCK(so); - if ((so->so_options & SO_ACCEPTCONN) == 0 || - so->sol_accept_filter != NULL) { + if (!SOLISTENING(so) || so->sol_accept_filter != NULL) { error = EINVAL; goto out; } diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 852132e45e58..070ed440b500 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1176,7 +1176,6 @@ int soclose(struct socket *so) { struct accept_queue lqueue; - bool listening; int error = 0; KASSERT(!(so->so_state & SS_NOFDREF), ("soclose: SS_NOFDREF on enter")); @@ -1212,7 +1211,7 @@ drop: (*so->so_proto->pr_usrreqs->pru_close)(so); SOCK_LOCK(so); - if ((listening = (so->so_options & SO_ACCEPTCONN))) { + if (SOLISTENING(so)) { struct socket *sp; TAILQ_INIT(&lqueue); @@ -1233,7 +1232,7 @@ drop: KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); so->so_state |= SS_NOFDREF; sorele(so); - if (listening) { + if (SOLISTENING(so)) { struct socket *sp, *tsp; TAILQ_FOREACH_SAFE(sp, &lqueue, so_list, tsp) { @@ -1313,7 +1312,8 @@ soconnectat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td) { int error; - if (so->so_options & SO_ACCEPTCONN) + /* XXXMJ racy */ + if (SOLISTENING(so)) return (EOPNOTSUPP); CURVNET_SET(so->so_vnet); diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 23fae343924a..18505b54d603 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -338,7 +338,7 @@ kern_accept4(struct thread *td, int s, struct sockaddr **name, if (error != 0) return (error); head = headfp->f_data; - if ((head->so_options & SO_ACCEPTCONN) == 0) { + if (!SOLISTENING(head)) { error = EINVAL; goto done; } diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 4466ae8822cd..a01171424320 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1602,7 +1602,7 @@ unp_connectat(int fd, struct socket *so, struct sockaddr *nam, goto bad2; } if (connreq) { - if (so2->so_options & SO_ACCEPTCONN) { + if (SOLISTENING(so2)) { CURVNET_SET(so2->so_vnet); so2 = sonewconn(so2, 0); CURVNET_RESTORE(); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c index 2bd15ac35895..cd620fe3aef9 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c @@ -2733,8 +2733,7 @@ ng_btsocket_l2cap_pcb_by_addr(bdaddr_p bdaddr, int psm) mtx_assert(&ng_btsocket_l2cap_sockets_mtx, MA_OWNED); LIST_FOREACH(p, &ng_btsocket_l2cap_sockets, next) { - if (p->so == NULL || !(p->so->so_options & SO_ACCEPTCONN) || - p->psm != psm) + if (p->so == NULL || !SOLISTENING(p->so) || p->psm != psm) continue; if (bcmp(&p->src, bdaddr, sizeof(p->src)) == 0) diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c index 95b28e6cc5e7..c0704bce55fa 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c @@ -3398,8 +3398,7 @@ ng_btsocket_rfcomm_pcb_listener(bdaddr_p src, int channel) mtx_lock(&ng_btsocket_rfcomm_sockets_mtx); LIST_FOREACH(pcb, &ng_btsocket_rfcomm_sockets, next) { - if (pcb->channel != channel || - !(pcb->so->so_options & SO_ACCEPTCONN)) + if (pcb->channel != channel || !SOLISTENING(pcb->so)) continue; if (bcmp(&pcb->src, src, sizeof(*src)) == 0) diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c index da8f22befc79..068b1890f27f 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c @@ -1829,7 +1829,7 @@ ng_btsocket_sco_pcb_by_addr(bdaddr_p bdaddr) LIST_FOREACH(p, &ng_btsocket_sco_sockets, next) { mtx_lock(&p->pcb_mtx); - if (p->so == NULL || !(p->so->so_options & SO_ACCEPTCONN)) { + if (p->so == NULL || !SOLISTENING(p->so)) { mtx_unlock(&p->pcb_mtx); continue; } diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 19232218170b..6d86e43f07dd 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -950,8 +950,7 @@ findpcb: } if ((inp->inp_flowtype == M_HASHTYPE_NONE) && (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) && - ((inp->inp_socket == NULL) || - (inp->inp_socket->so_options & SO_ACCEPTCONN) == 0)) { + ((inp->inp_socket == NULL) || !SOLISTENING(inp->inp_socket))) { inp->inp_flowid = m->m_pkthdr.flowid; inp->inp_flowtype = M_HASHTYPE_GET(m); } @@ -1061,9 +1060,9 @@ findpcb: * state) we look into the SYN cache if this is a new connection * attempt or the completion of a previous one. */ - KASSERT(tp->t_state == TCPS_LISTEN || !(so->so_options & SO_ACCEPTCONN), + KASSERT(tp->t_state == TCPS_LISTEN || !SOLISTENING(so), ("%s: so accepting but tp %p not listening", __func__, tp)); - if (tp->t_state == TCPS_LISTEN && (so->so_options & SO_ACCEPTCONN)) { + if (tp->t_state == TCPS_LISTEN && SOLISTENING(so)) { struct in_conninfo inc; bzero(&inc, sizeof(inc)); diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index ec162d889902..32a814ac2c4e 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -3666,8 +3666,8 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) tcp_twclose(tw, 0); else INP_WUNLOCK(inp); - } else if (!(inp->inp_flags & INP_DROPPED) && - !(inp->inp_socket->so_options & SO_ACCEPTCONN)) { + } else if ((inp->inp_flags & INP_DROPPED) == 0 && + !SOLISTENING(inp->inp_socket)) { tp = intotcpcb(inp); tp = tcp_drop(tp, ECONNABORTED); if (tp != NULL) diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index 6cff3434364d..67951108b01c 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -329,7 +329,7 @@ svc_vc_accept(struct socket *head, struct socket **sop) short nbio; /* XXXGL: shouldn't that be an assertion? */ - if ((head->so_options & SO_ACCEPTCONN) == 0) { + if (!SOLISTENING(head)) { error = EINVAL; goto done; } From owner-dev-commits-src-branches@freebsd.org Mon Jun 21 19:11:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 17BBA64DEE0; Mon, 21 Jun 2021 19:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G7zfS0C98z4dcg; Mon, 21 Jun 2021 19:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3E6F2247C; Mon, 21 Jun 2021 19:11:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15LJBhVQ048096; Mon, 21 Jun 2021 19:11:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15LJBhMN048095; Mon, 21 Jun 2021 19:11:43 GMT (envelope-from git) Date: Mon, 21 Jun 2021 19:11:43 GMT Message-Id: <202106211911.15LJBhMN048095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 27693a604a78 - stable/13 - Export various 128 bit long double functions from libgcc_s.so.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 27693a604a78f45f01737a0f40b7cf1890d20afb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 19:11:44 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=27693a604a78f45f01737a0f40b7cf1890d20afb commit 27693a604a78f45f01737a0f40b7cf1890d20afb Author: Dimitry Andric AuthorDate: 2021-06-14 19:17:05 +0000 Commit: Dimitry Andric CommitDate: 2021-06-21 19:07:14 +0000 Export various 128 bit long double functions from libgcc_s.so.1 These were already compiled for some time on aarch64 and riscv, by including lib/libcompiler_rt/Makefile.inc, but never exported in the shared library. Since gcc exports these under version GCC_4.6.0, we do the same. This review should replace D11482 for now. For e.g. amd64 more work is still to be done, as compiler-rt does not seem to support 128 bit long double math for that architecture. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D28690 (cherry picked from commit 790a6be5a1699291c6da87871426d0c56dedcc89) --- lib/libgcc_s/Symbol.map | 29 +++++++++++++++++++++++++++++ lib/libgcc_s/Versions.def | 3 +++ 2 files changed, 32 insertions(+) diff --git a/lib/libgcc_s/Symbol.map b/lib/libgcc_s/Symbol.map index 695f61893360..2580623d778b 100644 --- a/lib/libgcc_s/Symbol.map +++ b/lib/libgcc_s/Symbol.map @@ -148,3 +148,32 @@ GCC_4.3.0 { __bswapdi2; __bswapsi2; }; + +GCC_4.6.0 { + __addtf3; + __cmptf2; + __divtf3; + __eqtf2; + __extenddftf2; + __extendsftf2; + __fixtfdi; + __fixtfsi; + __fixtfti; + __fixunstfdi; + __fixunstfsi; + __fixunstfti; + __floatsitf; + __floattitf; + __floatunsitf; + __floatuntitf; + __getf2; + __gttf2; + __letf2; + __lttf2; + __multf3; + __netf2; + __subtf3; + __trunctfdf2; + __trunctfsf2; + __unordtf2; +}; diff --git a/lib/libgcc_s/Versions.def b/lib/libgcc_s/Versions.def index 2c9fdc00e3b5..16ef1d3fc504 100644 --- a/lib/libgcc_s/Versions.def +++ b/lib/libgcc_s/Versions.def @@ -29,3 +29,6 @@ GCC_4.2.0 { GCC_4.3.0 { } GCC_4.2.0; + +GCC_4.6.0 { +} GCC_4.3.0; From owner-dev-commits-src-branches@freebsd.org Mon Jun 21 19:12:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 A6E6E64DEEB; Mon, 21 Jun 2021 19:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G7zfz4J4qz4dqT; Mon, 21 Jun 2021 19:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BDF522ABD; Mon, 21 Jun 2021 19:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15LJCBRn048245; Mon, 21 Jun 2021 19:12:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15LJCB1B048244; Mon, 21 Jun 2021 19:12:11 GMT (envelope-from git) Date: Mon, 21 Jun 2021 19:12:11 GMT Message-Id: <202106211912.15LJCB1B048244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: d552a12be263 - stable/12 - Export various 128 bit long double functions from libgcc_s.so.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d552a12be263ee3bccfcbe7ca1f56ebb7b13f10c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 19:12:11 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d552a12be263ee3bccfcbe7ca1f56ebb7b13f10c commit d552a12be263ee3bccfcbe7ca1f56ebb7b13f10c Author: Dimitry Andric AuthorDate: 2021-06-14 19:17:05 +0000 Commit: Dimitry Andric CommitDate: 2021-06-21 19:09:02 +0000 Export various 128 bit long double functions from libgcc_s.so.1 These were already compiled for some time on aarch64 and riscv, by including lib/libcompiler_rt/Makefile.inc, but never exported in the shared library. Since gcc exports these under version GCC_4.6.0, we do the same. This review should replace D11482 for now. For e.g. amd64 more work is still to be done, as compiler-rt does not seem to support 128 bit long double math for that architecture. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D28690 (cherry picked from commit 790a6be5a1699291c6da87871426d0c56dedcc89) --- lib/libgcc_s/Symbol.map | 29 +++++++++++++++++++++++++++++ lib/libgcc_s/Versions.def | 3 +++ 2 files changed, 32 insertions(+) diff --git a/lib/libgcc_s/Symbol.map b/lib/libgcc_s/Symbol.map index 695f61893360..2580623d778b 100644 --- a/lib/libgcc_s/Symbol.map +++ b/lib/libgcc_s/Symbol.map @@ -148,3 +148,32 @@ GCC_4.3.0 { __bswapdi2; __bswapsi2; }; + +GCC_4.6.0 { + __addtf3; + __cmptf2; + __divtf3; + __eqtf2; + __extenddftf2; + __extendsftf2; + __fixtfdi; + __fixtfsi; + __fixtfti; + __fixunstfdi; + __fixunstfsi; + __fixunstfti; + __floatsitf; + __floattitf; + __floatunsitf; + __floatuntitf; + __getf2; + __gttf2; + __letf2; + __lttf2; + __multf3; + __netf2; + __subtf3; + __trunctfdf2; + __trunctfsf2; + __unordtf2; +}; diff --git a/lib/libgcc_s/Versions.def b/lib/libgcc_s/Versions.def index 2c9fdc00e3b5..16ef1d3fc504 100644 --- a/lib/libgcc_s/Versions.def +++ b/lib/libgcc_s/Versions.def @@ -29,3 +29,6 @@ GCC_4.2.0 { GCC_4.3.0 { } GCC_4.2.0; + +GCC_4.6.0 { +} GCC_4.3.0; From owner-dev-commits-src-branches@freebsd.org Mon Jun 21 19:12:34 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 6984964E513; Mon, 21 Jun 2021 19:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G7zgQ2c5gz4fCy; Mon, 21 Jun 2021 19:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4207E22A4B; Mon, 21 Jun 2021 19:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15LJCYHe048384; Mon, 21 Jun 2021 19:12:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15LJCYoi048383; Mon, 21 Jun 2021 19:12:34 GMT (envelope-from git) Date: Mon, 21 Jun 2021 19:12:34 GMT Message-Id: <202106211912.15LJCYoi048383@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: f616d57736dc - stable/11 - Export various 128 bit long double functions from libgcc_s.so.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: f616d57736dc663ae5cae08f2f3c3c34c199bcd4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 19:12:34 -0000 The branch stable/11 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f616d57736dc663ae5cae08f2f3c3c34c199bcd4 commit f616d57736dc663ae5cae08f2f3c3c34c199bcd4 Author: Dimitry Andric AuthorDate: 2021-06-14 19:17:05 +0000 Commit: Dimitry Andric CommitDate: 2021-06-21 19:09:47 +0000 Export various 128 bit long double functions from libgcc_s.so.1 These were already compiled for some time on aarch64 and riscv, by including lib/libcompiler_rt/Makefile.inc, but never exported in the shared library. Since gcc exports these under version GCC_4.6.0, we do the same. This review should replace D11482 for now. For e.g. amd64 more work is still to be done, as compiler-rt does not seem to support 128 bit long double math for that architecture. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D28690 (cherry picked from commit 790a6be5a1699291c6da87871426d0c56dedcc89) --- lib/libgcc_s/Symbol.map | 29 +++++++++++++++++++++++++++++ lib/libgcc_s/Versions.def | 3 +++ 2 files changed, 32 insertions(+) diff --git a/lib/libgcc_s/Symbol.map b/lib/libgcc_s/Symbol.map index 695f61893360..2580623d778b 100644 --- a/lib/libgcc_s/Symbol.map +++ b/lib/libgcc_s/Symbol.map @@ -148,3 +148,32 @@ GCC_4.3.0 { __bswapdi2; __bswapsi2; }; + +GCC_4.6.0 { + __addtf3; + __cmptf2; + __divtf3; + __eqtf2; + __extenddftf2; + __extendsftf2; + __fixtfdi; + __fixtfsi; + __fixtfti; + __fixunstfdi; + __fixunstfsi; + __fixunstfti; + __floatsitf; + __floattitf; + __floatunsitf; + __floatuntitf; + __getf2; + __gttf2; + __letf2; + __lttf2; + __multf3; + __netf2; + __subtf3; + __trunctfdf2; + __trunctfsf2; + __unordtf2; +}; diff --git a/lib/libgcc_s/Versions.def b/lib/libgcc_s/Versions.def index 2c9fdc00e3b5..16ef1d3fc504 100644 --- a/lib/libgcc_s/Versions.def +++ b/lib/libgcc_s/Versions.def @@ -29,3 +29,6 @@ GCC_4.2.0 { GCC_4.3.0 { } GCC_4.2.0; + +GCC_4.6.0 { +} GCC_4.3.0; From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 01:09:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 8698B653696; Tue, 22 Jun 2021 01:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G87bY3D21z3mWX; Tue, 22 Jun 2021 01:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56D2727895; Tue, 22 Jun 2021 01:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15M19jsB013409; Tue, 22 Jun 2021 01:09:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15M19jxB013408; Tue, 22 Jun 2021 01:09:45 GMT (envelope-from git) Date: Tue, 22 Jun 2021 01:09:45 GMT Message-Id: <202106220109.15M19jxB013408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: df57775d7a80 - stable/13 - hyperv: Fix vmbus after the i386 4/4 split MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df57775d7a806ace688822dbc272e3672628163d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 01:09:45 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=df57775d7a806ace688822dbc272e3672628163d commit df57775d7a806ace688822dbc272e3672628163d Author: Mark Johnston AuthorDate: 2021-06-08 13:40:30 +0000 Commit: Mark Johnston CommitDate: 2021-06-22 01:09:17 +0000 hyperv: Fix vmbus after the i386 4/4 split The vmbus ISR needs to live in a trampoline. Dynamically allocating a trampoline at driver initialization time poses some difficulties due to the fact that the KENTER macro assumes that the offset relative to tramp_idleptd is fixed at static link time. Another problem is that native_lapic_ipi_alloc() uses setidt(), which assumes a fixed trampoline offset. Rather than fight this, move the Hyper-V ISR to i386/exception.s. Add a new HYPERV kernel option to make this optional, and configure it by default on i386. This is sufficient to make use of vmbus(4) after the 4/4 split. Note that vmbus cannot be loaded dynamically and both the HYPERV option and device must be configured together. I think this is not too onerous a requirement, since vmbus(4) was previously non-functional. Reported by: Harry Schmalzbauer Tested by: Harry Schmalzbauer Reviewed by: whu, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 97993d1ebf592ac6689a498d5d0d2afb46758680) --- sys/conf/files.i386 | 1 - sys/conf/options.i386 | 3 +++ sys/dev/hyperv/vmbus/i386/vmbus_vector.S | 6 +++++- sys/i386/conf/GENERIC | 4 +++- sys/i386/i386/exception.s | 9 +++++++++ sys/modules/hyperv/vmbus/Makefile | 5 ++++- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index de759a9f7c83..4bbd584cb831 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -101,7 +101,6 @@ dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb dev/hyperv/vmbus/i386/hyperv_machdep.c optional hyperv -dev/hyperv/vmbus/i386/vmbus_vector.S optional hyperv dev/le/if_le_isa.c optional le isa dev/nctgpio/nctgpio.c optional nctgpio dev/nfe/if_nfe.c optional nfe pci diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index 73957449413f..fea6efdb991d 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -110,6 +110,9 @@ NPX_DEBUG opt_npx.h # BPF just-in-time compiler BPF_JITTER opt_bpf.h +# Hyper-V support +HYPERV opt_hyperv.h + XENHVM opt_global.h # options for the Intel C600 SAS driver (isci) diff --git a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S index f503e3d81203..4bb51be2623d 100644 --- a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S +++ b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S @@ -35,6 +35,9 @@ /* * This is the Hyper-V vmbus channel direct callback interrupt. * Only used when it is running on Hyper-V. + * + * Note that this file is not compiled directly, it is included into + * i386/exception.s. */ .text SUPERALIGN_TEXT @@ -46,7 +49,8 @@ IDTVEC(vmbus_isr) KENTER FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp - call vmbus_handle_intr + mov $vmbus_handle_intr, %eax + call *%eax add $4, %esp MEXITCOUNT jmp doreti diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 702f6d64223c..fd8290a56929 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -328,7 +328,9 @@ device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers and enhancement support -device hyperv # HyperV drivers +# NOTE: HYPERV depends on hyperv. They must be added or removed together. +options HYPERV # Kernel support for HyperV drivers +device hyperv # HyperV drivers # Xen HVM Guest Optimizations # NOTE: XENHVM depends on xenpci. They must be added or removed together. diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index b288543dafe1..4e806e8b3bd9 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -39,6 +39,7 @@ #include "opt_apic.h" #include "opt_atpic.h" #include "opt_hwpmc_hooks.h" +#include "opt_hyperv.h" #include "assym.inc" @@ -428,6 +429,14 @@ MCOUNT_LABEL(bintr) #ifdef DEV_APIC #include +#endif + +#ifdef HYPERV + .data + .p2align 4 + .text + SUPERALIGN_TEXT +#include #endif .data diff --git a/sys/modules/hyperv/vmbus/Makefile b/sys/modules/hyperv/vmbus/Makefile index 435106c7e9bd..47a83e76204a 100644 --- a/sys/modules/hyperv/vmbus/Makefile +++ b/sys/modules/hyperv/vmbus/Makefile @@ -13,8 +13,11 @@ SRCS= hyperv.c \ vmbus_et.c \ vmbus_if.c \ vmbus_res.c \ - vmbus_vector.S \ vmbus_xact.c + +.if ${MACHINE_CPUARCH} != "i386" +SRCS+= vmbus_vector.S +.endif SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h pci_if.h pcib_if.h vmbus_if.h # XXX: for assym.inc From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 01:09:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 B2F1F653793; Tue, 22 Jun 2021 01:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G87bZ4BLCz3mcP; Tue, 22 Jun 2021 01:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 783772763A; Tue, 22 Jun 2021 01:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15M19k1S013433; Tue, 22 Jun 2021 01:09:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15M19kQG013432; Tue, 22 Jun 2021 01:09:46 GMT (envelope-from git) Date: Tue, 22 Jun 2021 01:09:46 GMT Message-Id: <202106220109.15M19kQG013432@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a1022bc53e6b - stable/13 - i386: Add "options HYPERV" to NOTES MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a1022bc53e6b80512ada0ef10fd500861e5c086d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 01:09:46 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a1022bc53e6b80512ada0ef10fd500861e5c086d commit a1022bc53e6b80512ada0ef10fd500861e5c086d Author: Mark Johnston AuthorDate: 2021-06-09 12:58:45 +0000 Commit: Mark Johnston CommitDate: 2021-06-22 01:09:34 +0000 i386: Add "options HYPERV" to NOTES This unbreaks the LINT build. Fixes: 97993d1ebf Reported by: mjg (cherry picked from commit 334335cb14d4754d45265d19cd3c6e7708cca0c1) --- sys/i386/conf/NOTES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 47626787cab9..63059bf5c62e 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -723,7 +723,8 @@ device virtio_balloon # VirtIO Memory Balloon device device virtio_random # VirtIO Entropy device device virtio_console # VirtIO Console device -device hyperv # HyperV drivers +options HYPERV +device hyperv # HyperV drivers ##################################################################### From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 01:46:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 1EB74653B5E; Tue, 22 Jun 2021 01:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G88PW64x6z4T0k; Tue, 22 Jun 2021 01:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA44927AEB; Tue, 22 Jun 2021 01:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15M1k7hG065946; Tue, 22 Jun 2021 01:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15M1k75L065945; Tue, 22 Jun 2021 01:46:07 GMT (envelope-from git) Date: Tue, 22 Jun 2021 01:46:07 GMT Message-Id: <202106220146.15M1k75L065945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 299912abf269 - stable/13 - sigwait(2) and sigtimedwait(2) must not be restarted. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 299912abf26990afdc406ecd3a12f256a8080afe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 01:46:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=299912abf26990afdc406ecd3a12f256a8080afe commit 299912abf26990afdc406ecd3a12f256a8080afe Author: Konstantin Belousov AuthorDate: 2021-06-06 23:00:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-22 01:45:31 +0000 sigwait(2) and sigtimedwait(2) must not be restarted. (cherry picked from commit afb36e289c1d96053b6063b0e548fc7d31dbd239) --- sys/kern/kern_sig.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 0453d3b2702c..a2709f38c5cb 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1168,9 +1168,7 @@ sys_sigwait(struct thread *td, struct sigwait_args *uap) error = kern_sigtimedwait(td, set, &ksi, NULL); if (error) { if (error == EINTR && td->td_proc->p_osrel < P_OSREL_SIGWAIT) - error = ERESTART; - if (error == ERESTART) - return (error); + return (ERESTART); td->td_retval[0] = error; return (0); } @@ -1329,15 +1327,13 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, error = msleep(ps, &p->p_mtx, PPAUSE|PCATCH, "sigwait", timo); - if (timeout != NULL) { - if (error == ERESTART) { - /* Timeout can not be restarted. */ - error = EINTR; - } else if (error == EAGAIN) { - /* We will calculate timeout by ourself. */ - error = 0; - } - } + /* The syscalls can not be restarted. */ + if (error == ERESTART) + error = EINTR; + + /* We will calculate timeout by ourself. */ + if (timeout != NULL && error == EAGAIN) + error = 0; /* * If PTRACE_SCE or PTRACE_SCX were set after From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 01:46:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 0FBD56537EB; Tue, 22 Jun 2021 01:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G88PX73d4z4T6K; Tue, 22 Jun 2021 01:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA1AE27979; Tue, 22 Jun 2021 01:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15M1k8md065976; Tue, 22 Jun 2021 01:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15M1k8V7065975; Tue, 22 Jun 2021 01:46:08 GMT (envelope-from git) Date: Tue, 22 Jun 2021 01:46:08 GMT Message-Id: <202106220146.15M1k8V7065975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: fc13cbaf6942 - stable/13 - sigwait: add comment explaining EINTR/ERESTART details MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc13cbaf6942af73d50659e4728b6b1299a0d028 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 01:46:09 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fc13cbaf6942af73d50659e4728b6b1299a0d028 commit fc13cbaf6942af73d50659e4728b6b1299a0d028 Author: Konstantin Belousov AuthorDate: 2021-06-07 14:59:41 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-22 01:45:31 +0000 sigwait: add comment explaining EINTR/ERESTART details (cherry picked from commit acced8b043c5df0ebd51934bca6dcae3322cf890) --- sys/kern/kern_sig.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index a2709f38c5cb..1cab25aa5a40 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1167,6 +1167,13 @@ sys_sigwait(struct thread *td, struct sigwait_args *uap) error = kern_sigtimedwait(td, set, &ksi, NULL); if (error) { + /* + * sigwait() function shall not return EINTR, but + * the syscall does. Non-ancient libc provides the + * wrapper which hides EINTR. Otherwise, EINTR return + * is used by libthr to handle required cancellation + * point in the sigwait(). + */ if (error == EINTR && td->td_proc->p_osrel < P_OSREL_SIGWAIT) return (ERESTART); td->td_retval[0] = error; From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 01:46:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 69BE7653E8D; Tue, 22 Jun 2021 01:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G88PZ2NVJz4TGV; Tue, 22 Jun 2021 01:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B64A27BEB; Tue, 22 Jun 2021 01:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15M1k9ej066001; Tue, 22 Jun 2021 01:46:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15M1k9v8066000; Tue, 22 Jun 2021 01:46:09 GMT (envelope-from git) Date: Tue, 22 Jun 2021 01:46:09 GMT Message-Id: <202106220146.15M1k9v8066000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4f88de7e09e7 - stable/13 - Add a knob to not drop signal with default ignored or ignored actions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f88de7e09e7a1370aebd0a7ef64b3e8134c0cd3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 01:46:10 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4f88de7e09e7a1370aebd0a7ef64b3e8134c0cd3 commit 4f88de7e09e7a1370aebd0a7ef64b3e8134c0cd3 Author: Konstantin Belousov AuthorDate: 2021-06-05 12:42:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-22 01:45:31 +0000 Add a knob to not drop signal with default ignored or ignored actions (cherry picked from commit bc38762474caed2d41d2562e28f56aa211f47ceb) --- sys/kern/kern_sig.c | 65 +++++++++++++++++++++++++++++++---------------------- sys/sys/proc.h | 1 + sys/sys/sysent.h | 1 + 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 1cab25aa5a40..4f6f424fb05d 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -163,6 +163,12 @@ SYSCTL_BOOL(_kern, OID_AUTO, sigfastblock_fetch_always, CTLFLAG_RWTUN, "Fetch sigfastblock word on each syscall entry for proper " "blocking semantic"); +static bool kern_sig_discard_ign = true; +SYSCTL_BOOL(_kern, OID_AUTO, sig_discard_ign, CTLFLAG_RWTUN, + &kern_sig_discard_ign, 0, + "Discard ignored signals on delivery, otherwise queue them to " + "the target queue"); + SYSINIT(signal, SI_SUB_P1003_1B, SI_ORDER_FIRST+3, sigqueue_start, NULL); /* @@ -1290,6 +1296,9 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, PROC_LOCK(p); saved_mask = td->td_sigmask; SIGSETNAND(td->td_sigmask, waitset); + if ((p->p_sysent->sv_flags & SV_SIG_DISCIGN) != 0 || + !kern_sig_discard_ign) + td->td_pflags2 |= TDP2_SIGWAIT; for (;;) { mtx_lock(&ps->ps_mtx); sig = cursig(td); @@ -1352,6 +1361,7 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, if (error == 0 && (p->p_ptevents & PTRACE_SYSCALL) != 0) traced = true; } + td->td_pflags2 &= ~TDP2_SIGWAIT; new_block = saved_mask; SIGSETNAND(new_block, td->td_sigmask); @@ -2200,22 +2210,25 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) SDT_PROBE3(proc, , , signal__send, td, p, sig); /* - * If the signal is being ignored, - * then we forget about it immediately. - * (Note: we don't set SIGCONT in ps_sigignore, - * and if it is set to SIG_IGN, - * action will be SIG_DFL here.) + * If the signal is being ignored, then we forget about it + * immediately, except when the target process executes + * sigwait(). (Note: we don't set SIGCONT in ps_sigignore, + * and if it is set to SIG_IGN, action will be SIG_DFL here.) */ mtx_lock(&ps->ps_mtx); if (SIGISMEMBER(ps->ps_sigignore, sig)) { - SDT_PROBE3(proc, , , signal__discard, td, p, sig); + if (kern_sig_discard_ign && + (p->p_sysent->sv_flags & SV_SIG_DISCIGN) == 0) { + SDT_PROBE3(proc, , , signal__discard, td, p, sig); - mtx_unlock(&ps->ps_mtx); - if (ksi && (ksi->ksi_flags & KSI_INS)) - ksiginfo_tryfree(ksi); - return (ret); - } - if (SIGISMEMBER(td->td_sigmask, sig)) + mtx_unlock(&ps->ps_mtx); + if (ksi && (ksi->ksi_flags & KSI_INS)) + ksiginfo_tryfree(ksi); + return (ret); + } else { + action = SIG_CATCH; + } + } else if (SIGISMEMBER(td->td_sigmask, sig)) action = SIG_HOLD; else if (SIGISMEMBER(ps->ps_sigcatch, sig)) action = SIG_CATCH; @@ -2950,11 +2963,13 @@ issignal(struct thread *td) } /* - * We should see pending but ignored signals - * only if P_TRACED was on when they were posted. + * We should allow pending but ignored signals below + * only if there is sigwait() active, or P_TRACED was + * on when they were posted. */ if (SIGISMEMBER(ps->ps_sigignore, sig) && - (p->p_flag & P_TRACED) == 0) { + (p->p_flag & P_TRACED) == 0 && + (td->td_pflags2 & TDP2_SIGWAIT) == 0) { sigqueue_delete(&td->td_sigqueue, sig); sigqueue_delete(&p->p_sigqueue, sig); continue; @@ -3066,10 +3081,11 @@ issignal(struct thread *td) PROC_SUNLOCK(p); mtx_lock(&ps->ps_mtx); goto next; - } else if (prop & SIGPROP_IGNORE) { + } else if ((prop & SIGPROP_IGNORE) != 0 && + (td->td_pflags2 & TDP2_SIGWAIT) == 0) { /* - * Except for SIGCONT, shouldn't get here. - * Default action is to ignore; drop it. + * Default action is to ignore; drop it if + * not in kern_sigtimedwait(). */ break; /* == ignore */ } else @@ -3077,15 +3093,10 @@ issignal(struct thread *td) /*NOTREACHED*/ case (intptr_t)SIG_IGN: - /* - * Masking above should prevent us ever trying - * to take action on an ignored signal other - * than SIGCONT, unless process is traced. - */ - if ((prop & SIGPROP_CONT) == 0 && - (p->p_flag & P_TRACED) == 0) - printf("issignal\n"); - break; /* == ignore */ + if ((td->td_pflags2 & TDP2_SIGWAIT) == 0) + break; /* == ignore */ + else + return (sig); default: /* diff --git a/sys/sys/proc.h b/sys/sys/proc.h index d4476ac8d410..373e62bd266d 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -529,6 +529,7 @@ do { \ #define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */ #define TDP2_COMPAT32RB 0x00000002 /* compat32 ABI for robust lists */ #define TDP2_ACCT 0x00000004 /* Doing accounting */ +#define TDP2_SIGWAIT 0x00000008 /* Ignore ignored signals */ /* * Reasons that the current thread can not be run yet. diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index c2cbd77a92b9..95e9dcb1a335 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -161,6 +161,7 @@ struct sysentvec { #define SV_TIMEKEEP 0x040000 /* Shared page timehands. */ #define SV_ASLR 0x080000 /* ASLR allowed. */ #define SV_RNG_SEED_VER 0x100000 /* random(4) reseed generation. */ +#define SV_SIG_DISCIGN 0x200000 /* Do not discard ignored signals */ #define SV_ABI_MASK 0xff #define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 01:46:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 9ADE9653C97; Tue, 22 Jun 2021 01:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G88Pb3bpcz4TJr; Tue, 22 Jun 2021 01:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E1F327E59; Tue, 22 Jun 2021 01:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15M1kBDw066025; Tue, 22 Jun 2021 01:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15M1kBjO066024; Tue, 22 Jun 2021 01:46:11 GMT (envelope-from git) Date: Tue, 22 Jun 2021 01:46:11 GMT Message-Id: <202106220146.15M1kBjO066024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2ea2987d14d4 - stable/13 - Add a knob to disable dequeueing SIGCHLD on waiting for live process MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2ea2987d14d4d58fc6afe15e790dc9aa075038cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 01:46:11 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2ea2987d14d4d58fc6afe15e790dc9aa075038cc commit 2ea2987d14d4d58fc6afe15e790dc9aa075038cc Author: Konstantin Belousov AuthorDate: 2021-06-05 18:24:35 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-22 01:45:32 +0000 Add a knob to disable dequeueing SIGCHLD on waiting for live process (cherry picked from commit a12e901a5a65417849c1ccf1e37b8d092fa438da) --- sys/kern/kern_exit.c | 14 +++++++++++--- sys/sys/sysent.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index cb5996982a3a..fcd8b39a8ee2 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -105,6 +105,11 @@ SYSCTL_INT(_kern, OID_AUTO, kill_on_debugger_exit, CTLFLAG_RWTUN, &kern_kill_on_dbg_exit, 0, "Kill ptraced processes when debugger exits"); +static bool kern_wait_dequeue_sigchld = 1; +SYSCTL_BOOL(_kern, OID_AUTO, wait_dequeue_sigchld, CTLFLAG_RWTUN, + &kern_wait_dequeue_sigchld, 0, + "Dequeue SIGCHLD on wait(2) for live process"); + struct proc * proc_realparent(struct proc *child) { @@ -1207,9 +1212,12 @@ report_alive_proc(struct thread *td, struct proc *p, siginfo_t *siginfo, p->p_flag &= ~P_CONTINUED; else p->p_flag |= P_WAITED; - PROC_LOCK(td->td_proc); - sigqueue_take(p->p_ksi); - PROC_UNLOCK(td->td_proc); + if (kern_wait_dequeue_sigchld && + (td->td_proc->p_sysent->sv_flags & SV_SIG_WAITNDQ) == 0) { + PROC_LOCK(td->td_proc); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(td->td_proc); + } } sx_xunlock(&proctree_lock); if (siginfo != NULL) { diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 95e9dcb1a335..8b0903f7dcc0 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -162,6 +162,7 @@ struct sysentvec { #define SV_ASLR 0x080000 /* ASLR allowed. */ #define SV_RNG_SEED_VER 0x100000 /* random(4) reseed generation. */ #define SV_SIG_DISCIGN 0x200000 /* Do not discard ignored signals */ +#define SV_SIG_WAITNDQ 0x400000 /* Wait does not dequeue SIGCHLD */ #define SV_ABI_MASK 0xff #define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 01:46:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 B95C46539A9; Tue, 22 Jun 2021 01:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G88Pc39qPz4TJy; Tue, 22 Jun 2021 01:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5074C1A3; Tue, 22 Jun 2021 01:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15M1kCDs066049; Tue, 22 Jun 2021 01:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15M1kCFd066048; Tue, 22 Jun 2021 01:46:12 GMT (envelope-from git) Date: Tue, 22 Jun 2021 01:46:12 GMT Message-Id: <202106220146.15M1kCFd066048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 52d8029e935b - stable/13 - Add quirks for Linux ABI signals handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 52d8029e935b0cde48936151af9dd7a82e90c51c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 01:46:12 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=52d8029e935b0cde48936151af9dd7a82e90c51c commit 52d8029e935b0cde48936151af9dd7a82e90c51c Author: Konstantin Belousov AuthorDate: 2021-06-05 18:18:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-22 01:45:32 +0000 Add quirks for Linux ABI signals handling (cherry picked from commit 870e197d52c1cb8c3ed6d04ddae34dcae57cb657) --- sys/amd64/linux/linux_sysvec.c | 3 ++- sys/amd64/linux32/linux32_sysvec.c | 3 ++- sys/arm64/linux/linux_sysvec.c | 3 ++- sys/i386/linux/linux_sysvec.c | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 3766cea5e699..f8a06b08969e 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -751,7 +751,8 @@ struct sysentvec elf_linux_sysvec = { .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP, + .sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP | SV_SIG_DISCIGN | + SV_SIG_WAITNDQ, .sv_set_syscall_retval = linux_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 2fd246086810..b20961e66b6a 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -918,7 +918,8 @@ struct sysentvec elf_linux_sysvec = { .sv_setregs = linux_exec_setregs, .sv_fixlimit = linux32_fixlimit, .sv_maxssiz = &linux32_maxssiz, - .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32 | SV_SHP, + .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32 | SV_SHP | + SV_SIG_DISCIGN | SV_SIG_WAITNDQ, .sv_set_syscall_retval = linux32_set_syscall_retval, .sv_fetch_syscall_args = linux32_fetch_syscall_args, .sv_syscallnames = NULL, diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 7c88b0d9f2ea..30938251acd9 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -429,7 +429,8 @@ struct sysentvec elf_linux_sysvec = { .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP, + .sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP | SV_SIG_DISCIGN | + SV_SIG_WAITNDQ, .sv_set_syscall_retval = linux_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 1c92dafa7dcc..045c82aaf681 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -859,7 +859,8 @@ struct sysentvec linux_sysvec = { .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_LINUX | SV_AOUT | SV_IA32 | SV_ILP32, + .sv_flags = SV_ABI_LINUX | SV_AOUT | SV_IA32 | SV_ILP32 | + SV_SIG_DISCIGN | SV_SIG_WAITNDQ, .sv_set_syscall_retval = linux_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, @@ -897,7 +898,8 @@ struct sysentvec elf_linux_sysvec = { .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_LINUX | SV_IA32 | SV_ILP32 | SV_SHP, + .sv_flags = SV_ABI_LINUX | SV_IA32 | SV_ILP32 | SV_SHP | + SV_SIG_DISCIGN | SV_SIG_WAITNDQ, .sv_set_syscall_retval = linux_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 08:56:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 59AFB659454; Tue, 22 Jun 2021 08:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G8Kyd25cKz3kTm; Tue, 22 Jun 2021 08:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FAE8630A; Tue, 22 Jun 2021 08:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15M8uv7i044248; Tue, 22 Jun 2021 08:56:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15M8uvR6044247; Tue, 22 Jun 2021 08:56:57 GMT (envelope-from git) Date: Tue, 22 Jun 2021 08:56:57 GMT Message-Id: <202106220856.15M8uvR6044247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 25302a721f69 - stable/13 - zfs: merge openzfs/zfs@9a865b7fb (zfs-2.1-release) into stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25302a721f69d34c72d8bd3e0c316ad12647e281 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 08:56:57 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=25302a721f69d34c72d8bd3e0c316ad12647e281 commit 25302a721f69d34c72d8bd3e0c316ad12647e281 Merge: 52d8029e935b 9a865b7fb70f Author: Martin Matuska AuthorDate: 2021-06-22 07:16:24 +0000 Commit: Martin Matuska CommitDate: 2021-06-22 07:18:11 +0000 zfs: merge openzfs/zfs@9a865b7fb (zfs-2.1-release) into stable/13 Notable upstream pull request merges: #11904 libspl: implement atomics in terms of atomics Obtained from: OpenZFS OpenZFS commit: 9a865b7fb70f44e988f59b31b38eabafe363d6f8 cddl/lib/libspl/Makefile | 25 +- sys/contrib/openzfs/cmd/zed/Makefile.am | 2 +- sys/contrib/openzfs/config/user-libatomic.m4 | 34 + sys/contrib/openzfs/config/user.m4 | 1 + sys/contrib/openzfs/lib/libspl/Makefile.am | 27 +- .../openzfs/lib/libspl/asm-generic/.gitignore | 1 - sys/contrib/openzfs/lib/libspl/asm-i386/atomic.S | 853 --------------------- sys/contrib/openzfs/lib/libspl/asm-x86_64/atomic.S | 691 ----------------- .../openzfs/lib/libspl/{asm-generic => }/atomic.c | 185 ++--- sys/modules/zfs/zfs_config.h | 4 +- 10 files changed, 92 insertions(+), 1731 deletions(-) diff --cc cddl/lib/libspl/Makefile index c657dd9b2290,000000000000..e8d6368fce81 mode 100644,000000..100644 --- a/cddl/lib/libspl/Makefile +++ b/cddl/lib/libspl/Makefile @@@ -1,63 -1,0 +1,50 @@@ +# $FreeBSD$ + +.include +.include + +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl - .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/os/freebsd +.PATH: ${SRCTOP}/sys/contrib/openzfs/include + +LIB= spl +LIBADD= +PACKAGE= runtime + +SRCS = \ + assert.c \ + list.c \ + mkdirp.c \ ++ os/freebsd/zone.c \ + page.c \ + timestamp.c \ - zone.c \ + include/sys/list.h \ + include/sys/list_impl.h + +# These functions are not required when bootstrapping and the atomic code +# will not compile when building on macOS. +.if !defined(BOOTSTRAPPING) +SRCS += \ - getexecname.c \ - gethostid.c \ - getmntany.c \ - mnttab.c - - - .if ${MACHINE_ARCH} == "amd64" - .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-x86_64 - SRCS += atomic.S - .elif ${MACHINE_ARCH} == "i386" - .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-i386 - SRCS += atomic.S - .else - .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-generic - SRCS += atomic.c - .endif ++ atomic.c \ ++ os/freebsd/getexecname.c \ ++ os/freebsd/gethostid.c \ ++ os/freebsd/getmntany.c \ ++ os/freebsd/mnttab.c +.endif + + +WARNS?= 2 +CSTD= c99 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +.if ${COMPILER_TYPE} == "clang" +CFLAGS.atomic.c+= -Wno-error=atomic-alignment +.endif - CFLAGS.atomic.S+= -DLOCORE + +.include diff --cc sys/contrib/openzfs/config/user-libatomic.m4 index 000000000000,14a60bbea9d0..14a60bbea9d0 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/user-libatomic.m4 +++ b/sys/contrib/openzfs/config/user-libatomic.m4 diff --cc sys/modules/zfs/zfs_config.h index 344196bbede9,000000000000..59041ba82b69 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,774 -1,0 +1,774 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT_LEGACY */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* kernel has large stacks */ +/* #undef HAVE_LARGE_STACKS */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* iops->create()/mkdir()/mknod() take umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() is available */ +/* #undef HAVE_SETATTR_PREPARE */ + +/* iops->set_acl() exists */ +/* #undef HAVE_SET_ACL */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* ->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes a vfsmount */ +/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */ + +/* aops->direct_IO() uses iovec */ +/* #undef HAVE_VFS_DIRECT_IO_IOVEC */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* aops->direct_IO() uses iov_iter with rw and offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + +/* fops->iterate() is available */ +/* #undef HAVE_VFS_ITERATE */ + +/* fops->iterate_shared() is available */ +/* #undef HAVE_VFS_ITERATE_SHARED */ + +/* fops->readdir() is available */ +/* #undef HAVE_VFS_READDIR */ + +/* fops->read/write_iter() are available */ +/* #undef HAVE_VFS_RW_ITERATE */ + +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* yes */ +/* #undef HAVE_WAIT_ON_BIT_ACTION */ + +/* wait_queue_entry_t exists */ +/* #undef HAVE_WAIT_QUEUE_ENTRY_T */ + +/* wq_head->head and wq_entry->entry exist */ +/* #undef HAVE_WAIT_QUEUE_HEAD_ENTRY */ + +/* xattr_handler->get() wants dentry */ +/* #undef HAVE_XATTR_GET_DENTRY */ + +/* xattr_handler->get() wants both dentry and inode */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE */ + +/* xattr_handler->get() wants xattr_handler */ +/* #undef HAVE_XATTR_GET_HANDLER */ + +/* xattr_handler has name */ +/* #undef HAVE_XATTR_HANDLER_NAME */ + +/* xattr_handler->list() wants dentry */ +/* #undef HAVE_XATTR_LIST_DENTRY */ + +/* xattr_handler->list() wants xattr_handler */ +/* #undef HAVE_XATTR_LIST_HANDLER */ + +/* xattr_handler->list() wants simple */ +/* #undef HAVE_XATTR_LIST_SIMPLE */ + +/* xattr_handler->set() wants dentry */ +/* #undef HAVE_XATTR_SET_DENTRY */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() wants xattr_handler */ +/* #undef HAVE_XATTR_SET_HANDLER */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* __posix_acl_chmod() exists */ +/* #undef HAVE___POSIX_ACL_CHMOD */ + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* hardened module_param_call */ +/* #undef MODULE_PARAM_CALL_CONST */ + +/* struct shrink_control has nid */ +/* #undef SHRINK_CONTROL_HAS_NID */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE + +/* Defined for legacy compatibility. */ +#define SPL_META_VERSION ZFS_META_VERSION + +/* True if ZFS is to be compiled for a FreeBSD system */ +#define SYSTEM_FREEBSD 1 + +/* True if ZFS is to be compiled for a Linux system */ +/* #undef SYSTEM_LINUX */ + +/* zfs debugging enabled */ +/* #undef ZFS_DEBUG */ + +/* /dev/zfs minor */ +/* #undef ZFS_DEVICE_MINOR */ + +/* enum node_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum node_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum node_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* enum zone_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum zone_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum zone_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* global_node_page_state() exists */ +/* #undef ZFS_GLOBAL_NODE_PAGE_STATE */ + +/* global_zone_page_state() exists */ +/* #undef ZFS_GLOBAL_ZONE_PAGE_STATE */ + +/* Define to 1 if GPL-only symbols can be used */ +/* #undef ZFS_IS_GPL_COMPATIBLE */ + +/* Define the project alias string. */ - #define ZFS_META_ALIAS "zfs-2.1.0-FreeBSD_g3de7aeb68" ++#define ZFS_META_ALIAS "zfs-2.1.0-FreeBSD_g9a865b7fb" + +/* Define the project author. */ +#define ZFS_META_AUTHOR "OpenZFS" + +/* Define the project release date. */ +/* #undef ZFS_META_DATA */ + +/* Define the maximum compatible kernel version. */ +#define ZFS_META_KVER_MAX "5.12" + +/* Define the minimum compatible kernel version. */ +#define ZFS_META_KVER_MIN "3.10" + +/* Define the project license. */ +#define ZFS_META_LICENSE "CDDL" + +/* Define the libtool library 'age' version information. */ +/* #undef ZFS_META_LT_AGE */ + +/* Define the libtool library 'current' version information. */ +/* #undef ZFS_META_LT_CURRENT */ + +/* Define the libtool library 'revision' version information. */ +/* #undef ZFS_META_LT_REVISION */ + +/* Define the project name. */ +#define ZFS_META_NAME "zfs" + +/* Define the project release. */ - #define ZFS_META_RELEASE "FreeBSD_g3de7aeb68" ++#define ZFS_META_RELEASE "FreeBSD_g9a865b7fb" + +/* Define the project version. */ +#define ZFS_META_VERSION "2.1.0" + +/* count is located in percpu_ref.data */ +/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ + From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 09:02:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 5BE1E6596E2; Tue, 22 Jun 2021 09:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G8L4z24Ydz3kmd; Tue, 22 Jun 2021 09:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FDFC5FC7; Tue, 22 Jun 2021 09:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15M92RLE057855; Tue, 22 Jun 2021 09:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15M92RU7057854; Tue, 22 Jun 2021 09:02:27 GMT (envelope-from git) Date: Tue, 22 Jun 2021 09:02:27 GMT Message-Id: <202106220902.15M92RU7057854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 05e6f6b65080 - stable/13 - libspl: fix NO_CLEAN build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05e6f6b650801a8f3fb4dd7e50856b8479631990 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 09:02:27 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=05e6f6b650801a8f3fb4dd7e50856b8479631990 commit 05e6f6b650801a8f3fb4dd7e50856b8479631990 Author: Warner Losh AuthorDate: 2021-06-08 23:56:15 +0000 Commit: Martin Matuska CommitDate: 2021-06-22 09:01:06 +0000 libspl: fix NO_CLEAN build atomic.S moved to atomic.c, update the cleaup script to remove stale dependencies for this. Sponsored by: Netflix (cherry picked from commit dbbf7cb21ce3e40c9f96a24601fdc536b6e32aca) --- tools/build/depend-cleanup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 23bedee1ea26..ae393c2451f0 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -70,3 +70,6 @@ if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then echo "Removing stale ncurses objects" rm -rf "$OBJTOP"/lib/ncurses "$OBJTOP"/obj-lib32/lib/ncurses fi + +# 20210608 f20893853e8e move from atomic.S to atomic.c +clean_dep cddl/lib/libspl atomic S From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 19:26:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 658B866176C; Tue, 22 Jun 2021 19:26:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G8bx72C0rz3qtW; Tue, 22 Jun 2021 19:26:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3345316C0B; Tue, 22 Jun 2021 19:26:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15MJQZGi083635; Tue, 22 Jun 2021 19:26:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15MJQZSw083634; Tue, 22 Jun 2021 19:26:35 GMT (envelope-from git) Date: Tue, 22 Jun 2021 19:26:35 GMT Message-Id: <202106221926.15MJQZSw083634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: a7ade2196244 - stable/13 - kern.mk: fix -Wno-error style to fix build with Clang 12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a7ade2196244fa21bdee913fb9448d07e9f3760c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 19:26:35 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a7ade2196244fa21bdee913fb9448d07e9f3760c commit a7ade2196244fa21bdee913fb9448d07e9f3760c Author: Greg V AuthorDate: 2021-03-10 22:17:09 +0000 Commit: Dimitry Andric CommitDate: 2021-06-22 19:20:39 +0000 kern.mk: fix -Wno-error style to fix build with Clang 12 Clang 12 no longer supports -Wno-error-..., only the -Wno-error=... style (which is already used everywhere else in the tree). Differential Revision: https://reviews.freebsd.org/D29157 (cherry picked from commit 15565e0a2177f53b086609fecd48991c52dad5eb) --- sys/conf/kern.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 3f14a42ab226..f8ea372b1d93 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -17,21 +17,21 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # 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-error-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-error-unneeded-internal-declaration -NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized -NO_WCAST_QUAL= -Wno-error-cast-qual +NO_WUNNEEDED_INTERNAL_DECL= -Wno-error=unneeded-internal-declaration +NO_WSOMETIMES_UNINITIALIZED= -Wno-error=sometimes-uninitialized +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. -CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ - -Wno-error-parentheses-equality -Wno-error-unused-function \ - -Wno-error-pointer-sign -CWARNEXTRA+= -Wno-error-shift-negative-value +CWARNEXTRA?= -Wno-error=tautological-compare -Wno-error=empty-body \ + -Wno-error=parentheses-equality -Wno-error=unused-function \ + -Wno-error=pointer-sign +CWARNEXTRA+= -Wno-error=shift-negative-value CWARNEXTRA+= -Wno-address-of-packed-member .if ${COMPILER_VERSION} >= 100000 NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 19:41:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 D284F661BF3; Tue, 22 Jun 2021 19:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G8cGc5PjRz3rTs; Tue, 22 Jun 2021 19:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1D4716F15; Tue, 22 Jun 2021 19:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15MJfix2008883; Tue, 22 Jun 2021 19:41:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15MJfiBP008882; Tue, 22 Jun 2021 19:41:44 GMT (envelope-from git) Date: Tue, 22 Jun 2021 19:41:44 GMT Message-Id: <202106221941.15MJfiBP008882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 4636b3ca8744 - stable/12 - Remove a use of a negative array index from fxp(4). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4636b3ca8744eeb73562f3f950dc06ef54636d78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 19:41:44 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=4636b3ca8744eeb73562f3f950dc06ef54636d78 commit 4636b3ca8744eeb73562f3f950dc06ef54636d78 Author: Mark Johnston AuthorDate: 2018-12-19 04:54:32 +0000 Commit: Dimitry Andric CommitDate: 2021-06-22 19:35:49 +0000 Remove a use of a negative array index from fxp(4). This fixes a warning seen when compiling amd64 GENERIC with clang 7. Also remove the workaround added in r337324. clang 7 and gcc 4.2 generate the same code with or without the code change. Reviewed by: imp (previous version) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18603 (cherry picked from commit 0e4a3d93eefdc9730f572e8277b100eff6cf3491) --- sys/conf/files | 3 +-- sys/conf/kern.mk | 1 - sys/modules/fxp/Makefile | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 4195d5d21a53..624be0a7240b 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1812,8 +1812,7 @@ dev/flash/cqspi.c optional cqspi fdt xdma dev/flash/mx25l.c optional mx25l dev/flash/n25q.c optional n25q fdt dev/flash/qspi_if.m optional cqspi fdt | n25q fdt -dev/fxp/if_fxp.c optional fxp \ - compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS}" +dev/fxp/if_fxp.c optional fxp dev/fxp/inphy.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index fd9aadb58945..9c41852c6d9d 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -25,7 +25,6 @@ NO_WUNNEEDED_INTERNAL_DECL= -Wno-error-unneeded-internal-declaration NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized NO_WCAST_QUAL= -Wno-error-cast-qual NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare -NO_WARRAY_BOUNDS= -Wno-error-array-bounds # 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. diff --git a/sys/modules/fxp/Makefile b/sys/modules/fxp/Makefile index 6a47028f8822..fbe14392f69f 100644 --- a/sys/modules/fxp/Makefile +++ b/sys/modules/fxp/Makefile @@ -6,5 +6,3 @@ KMOD= if_fxp SRCS= device_if.h bus_if.h if_fxp.c inphy.c miibus_if.h miidevs.h pci_if.h .include - -CWARNFLAGS+= ${NO_WARRAY_BOUNDS} From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 19:41:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 01485662195; Tue, 22 Jun 2021 19:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G8cGd6VHkz3rX0; Tue, 22 Jun 2021 19:41:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C364016A79; Tue, 22 Jun 2021 19:41:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15MJfjoG008907; Tue, 22 Jun 2021 19:41:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15MJfjPe008906; Tue, 22 Jun 2021 19:41:45 GMT (envelope-from git) Date: Tue, 22 Jun 2021 19:41:45 GMT Message-Id: <202106221941.15MJfjPe008906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 742d31501978 - stable/12 - kern.mk: fix -Wno-error style to fix build with Clang 12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 742d315019789de01d5dbf736cbafd49cc603276 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 19:41:46 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=742d315019789de01d5dbf736cbafd49cc603276 commit 742d315019789de01d5dbf736cbafd49cc603276 Author: Greg V AuthorDate: 2021-03-10 22:17:09 +0000 Commit: Dimitry Andric CommitDate: 2021-06-22 19:39:01 +0000 kern.mk: fix -Wno-error style to fix build with Clang 12 Clang 12 no longer supports -Wno-error-..., only the -Wno-error=... style (which is already used everywhere else in the tree). Differential Revision: https://reviews.freebsd.org/D29157 (cherry picked from commit 15565e0a2177f53b086609fecd48991c52dad5eb) --- sys/conf/kern.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 9c41852c6d9d..fc42d0e0321a 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -17,22 +17,22 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # 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-error-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-error-unneeded-internal-declaration -NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized -NO_WCAST_QUAL= -Wno-error-cast-qual +NO_WUNNEEDED_INTERNAL_DECL= -Wno-error=unneeded-internal-declaration +NO_WSOMETIMES_UNINITIALIZED= -Wno-error=sometimes-uninitialized +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. -CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ - -Wno-error-parentheses-equality -Wno-error-unused-function \ - -Wno-error-pointer-sign +CWARNEXTRA?= -Wno-error=tautological-compare -Wno-error=empty-body \ + -Wno-error=parentheses-equality -Wno-error=unused-function \ + -Wno-error=pointer-sign .if ${COMPILER_VERSION} >= 30700 -CWARNEXTRA+= -Wno-error-shift-negative-value +CWARNEXTRA+= -Wno-error=shift-negative-value .endif .if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 19:48:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 967B966258E; Tue, 22 Jun 2021 19:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G8cQZ3fQYz3rmS; Tue, 22 Jun 2021 19:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 619841703D; Tue, 22 Jun 2021 19:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15MJmceI010419; Tue, 22 Jun 2021 19:48:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15MJmcSX010418; Tue, 22 Jun 2021 19:48:38 GMT (envelope-from git) Date: Tue, 22 Jun 2021 19:48:38 GMT Message-Id: <202106221948.15MJmcSX010418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: ff236cdc3893 - stable/11 - kern.mk: fix -Wno-error style to fix build with Clang 12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: ff236cdc389341c219a7de107a74bd86331780af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 19:48:38 -0000 The branch stable/11 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=ff236cdc389341c219a7de107a74bd86331780af commit ff236cdc389341c219a7de107a74bd86331780af Author: Greg V AuthorDate: 2021-03-10 22:17:09 +0000 Commit: Dimitry Andric CommitDate: 2021-06-22 19:45:51 +0000 kern.mk: fix -Wno-error style to fix build with Clang 12 Clang 12 no longer supports -Wno-error-..., only the -Wno-error=... style (which is already used everywhere else in the tree). Differential Revision: https://reviews.freebsd.org/D29157 (cherry picked from commit 15565e0a2177f53b086609fecd48991c52dad5eb) (cherry picked from commit 742d315019789de01d5dbf736cbafd49cc603276) --- sys/conf/kern.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 5a86134a8aef..6113e29aaa5b 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -17,22 +17,22 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # 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-error-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-error-unneeded-internal-declaration -NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized -NO_WCAST_QUAL= -Wno-error-cast-qual +NO_WUNNEEDED_INTERNAL_DECL= -Wno-error=unneeded-internal-declaration +NO_WSOMETIMES_UNINITIALIZED= -Wno-error=sometimes-uninitialized +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. -CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ - -Wno-error-parentheses-equality -Wno-error-unused-function \ - -Wno-error-pointer-sign +CWARNEXTRA?= -Wno-error=tautological-compare -Wno-error=empty-body \ + -Wno-error=parentheses-equality -Wno-error=unused-function \ + -Wno-error=pointer-sign .if ${COMPILER_VERSION} >= 30700 -CWARNEXTRA+= -Wno-error-shift-negative-value +CWARNEXTRA+= -Wno-error=shift-negative-value .endif .if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 21:03:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 06100662F47; Tue, 22 Jun 2021 21:03:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G8f566kpGz4TRJ; Tue, 22 Jun 2021 21:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF42E18207; Tue, 22 Jun 2021 21:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ML3cB6017229; Tue, 22 Jun 2021 21:03:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ML3cnA017228; Tue, 22 Jun 2021 21:03:38 GMT (envelope-from git) Date: Tue, 22 Jun 2021 21:03:38 GMT Message-Id: <202106222103.15ML3cnA017228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a20c597c6d73 - stable/13 - bsnmp: Fix incorrect use of libpfctl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a20c597c6d73a305126108eeacb5a2f4355ce6af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 21:03:39 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a20c597c6d73a305126108eeacb5a2f4355ce6af commit a20c597c6d73a305126108eeacb5a2f4355ce6af Author: Kristof Provost AuthorDate: 2021-06-15 08:50:32 +0000 Commit: Kristof Provost CommitDate: 2021-06-22 21:00:33 +0000 bsnmp: Fix incorrect use of libpfctl When we introduced libpfctl in bnsmpd this was done incorrectly, and a GETRULE call was replaced by pfctl_add_rule(). Change it to pfctl_get_rule(). Reviewed by: donner MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 67cef6d411cef0c3dfcf768ff890b4f97cf513b6) --- usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index 51d940f20c99..4ef35ac1eec2 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -1530,8 +1530,8 @@ pfl_scan_ruleset(const char *path) for (nr = pr.nr, i = 0; i < nr; i++) { pr.nr = i; - if (pfctl_add_rule(dev, &rule, pr.anchor, pr.anchor_call, - pr.ticket, pr.pool_ticket)) { + if (pfctl_get_rule(dev, pr.nr, pr.ticket, pr.anchor, + PF_PASS, &rule, pr.anchor_call)) { syslog(LOG_ERR, "pfl_scan_ruleset: ioctl(DIOCGETRULE):" " %s", strerror(errno)); goto err; From owner-dev-commits-src-branches@freebsd.org Tue Jun 22 21:04:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 9D49E662EAD; Tue, 22 Jun 2021 21:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G8f5n3DPSz4TVH; Tue, 22 Jun 2021 21:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56D3D18194; Tue, 22 Jun 2021 21:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ML4DFm017407; Tue, 22 Jun 2021 21:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ML4DsN017406; Tue, 22 Jun 2021 21:04:13 GMT (envelope-from git) Date: Tue, 22 Jun 2021 21:04:13 GMT Message-Id: <202106222104.15ML4DsN017406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c419c8231fbb - stable/12 - bsnmp: Fix incorrect use of libpfctl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c419c8231fbbd16bbed4ac0b50a78914a79963fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 21:04:13 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c419c8231fbbd16bbed4ac0b50a78914a79963fd commit c419c8231fbbd16bbed4ac0b50a78914a79963fd Author: Kristof Provost AuthorDate: 2021-06-15 08:50:32 +0000 Commit: Kristof Provost CommitDate: 2021-06-22 21:00:33 +0000 bsnmp: Fix incorrect use of libpfctl When we introduced libpfctl in bnsmpd this was done incorrectly, and a GETRULE call was replaced by pfctl_add_rule(). Change it to pfctl_get_rule(). Reviewed by: donner MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 67cef6d411cef0c3dfcf768ff890b4f97cf513b6) --- usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index 51d940f20c99..4ef35ac1eec2 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -1530,8 +1530,8 @@ pfl_scan_ruleset(const char *path) for (nr = pr.nr, i = 0; i < nr; i++) { pr.nr = i; - if (pfctl_add_rule(dev, &rule, pr.anchor, pr.anchor_call, - pr.ticket, pr.pool_ticket)) { + if (pfctl_get_rule(dev, pr.nr, pr.ticket, pr.anchor, + PF_PASS, &rule, pr.anchor_call)) { syslog(LOG_ERR, "pfl_scan_ruleset: ioctl(DIOCGETRULE):" " %s", strerror(errno)); goto err; From owner-dev-commits-src-branches@freebsd.org Thu Jun 24 02:32:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 84E0C65BD44; Thu, 24 Jun 2021 02:32:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9PKY35tzz4tMk; Thu, 24 Jun 2021 02:32:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 537627E59; Thu, 24 Jun 2021 02:32:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15O2W12C073378; Thu, 24 Jun 2021 02:32:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15O2W1xK073377; Thu, 24 Jun 2021 02:32:01 GMT (envelope-from git) Date: Thu, 24 Jun 2021 02:32:01 GMT Message-Id: <202106240232.15O2W1xK073377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 57184d6a6c7e - stable/13 - Un-staticise vm_page_init_page() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 57184d6a6c7eaa74a69520769ddbb8a85ae0475e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 02:32:01 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=57184d6a6c7eaa74a69520769ddbb8a85ae0475e commit 57184d6a6c7eaa74a69520769ddbb8a85ae0475e Author: Konstantin Belousov AuthorDate: 2021-06-17 10:58:13 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-24 02:20:33 +0000 Un-staticise vm_page_init_page() (cherry picked from commit 5b10e79edba561270001c097fbffcf05d07e9a4a) --- sys/vm/vm_page.c | 2 +- sys/vm/vm_page.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index c7d548471e89..cdcd9a366212 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -497,7 +497,7 @@ vm_page_domain_init(int domain) * Initialize a physical page in preparation for adding it to the free * lists. */ -static void +void vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segind) { diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index b05a3d1be861..d897a088244f 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -632,6 +632,7 @@ void vm_page_free_invalid(vm_page_t); vm_page_t vm_page_getfake(vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_initfake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_init_marker(vm_page_t marker, int queue, uint16_t aflags); +void vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segind); int vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); void vm_page_invalid(vm_page_t m); void vm_page_launder(vm_page_t m); From owner-dev-commits-src-branches@freebsd.org Thu Jun 24 02:32:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 C1EE765B95D; Thu, 24 Jun 2021 02:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9PKZ4t3Jz4tMn; Thu, 24 Jun 2021 02:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7855D7769; Thu, 24 Jun 2021 02:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15O2W2ZY073402; Thu, 24 Jun 2021 02:32:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15O2W2r4073401; Thu, 24 Jun 2021 02:32:02 GMT (envelope-from git) Date: Thu, 24 Jun 2021 02:32:02 GMT Message-Id: <202106240232.15O2W2r4073401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d16b938e7343 - stable/13 - amd64 efirt: initialize vm_pages backing EFI runtime memory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d16b938e734363457225ff92cef68301cbad0fce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 02:32:02 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d16b938e734363457225ff92cef68301cbad0fce commit d16b938e734363457225ff92cef68301cbad0fce Author: Konstantin Belousov AuthorDate: 2021-06-16 01:59:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-24 02:20:41 +0000 amd64 efirt: initialize vm_pages backing EFI runtime memory (cherry picked from commit 0247c33e89adaf0c7159b847ef7bae9566e55395) --- sys/amd64/amd64/efirt_machdep.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c index 1c53caaef601..9f0fb00aa2ef 100644 --- a/sys/amd64/amd64/efirt_machdep.c +++ b/sys/amd64/amd64/efirt_machdep.c @@ -180,6 +180,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) struct efi_md *p; pt_entry_t *pte; void *pml; + vm_page_t m; vm_offset_t va; uint64_t idx; int bits, i, mode; @@ -247,6 +248,14 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) va += PAGE_SIZE) { pte = efi_1t1_pte(va); pte_store(pte, va | bits); + + m = PHYS_TO_VM_PAGE(va); + if (m != NULL && VM_PAGE_TO_PHYS(m) == 0) { + vm_page_init_page(m, va, -1); + m->order = VM_NFREEORDER + 1; /* invalid */ + m->pool = VM_NFREEPOOL + 1; /* invalid */ + pmap_page_set_memattr(m, mode); + } } VM_OBJECT_WUNLOCK(obj_1t1_pt); } From owner-dev-commits-src-branches@freebsd.org Thu Jun 24 12:00:22 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 DE96F64A5CF; Thu, 24 Jun 2021 12:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9dxL61t2z3vvr; Thu, 24 Jun 2021 12:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7B1717559; Thu, 24 Jun 2021 12:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15OC0Mv4028254; Thu, 24 Jun 2021 12:00:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15OC0MBA028253; Thu, 24 Jun 2021 12:00:22 GMT (envelope-from git) Date: Thu, 24 Jun 2021 12:00:22 GMT Message-Id: <202106241200.15OC0MBA028253@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: db7136d6b97f - stable/11 - tests/netgraph: Fix build error due to missing directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: db7136d6b97f53e58976d20b454f7bb71322b07d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 12:00:22 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=db7136d6b97f53e58976d20b454f7bb71322b07d commit db7136d6b97f53e58976d20b454f7bb71322b07d Author: Lutz Donnerhacke AuthorDate: 2021-06-24 11:54:54 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-24 11:54:54 +0000 tests/netgraph: Fix build error due to missing directory While MFCing the tests into stable/11 the test directory needs to be added, because earlier netgraph tests were not MFCed to this train. PR: 256773 Reported by: Arrigo Marchiori Submitted by: Arrigo Marchiori Tested by: Arrigo Marchiori This is a direct commit into the stable/11 branch. --- etc/mtree/BSD.tests.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 12a7e7d3401e..9fff7a9122b0 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -488,6 +488,8 @@ .. net .. + netgraph + .. netinet .. netmap From owner-dev-commits-src-branches@freebsd.org Thu Jun 24 12:07:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 AE85564A92F; Thu, 24 Jun 2021 12:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9f5y4LsXz3wCv; Thu, 24 Jun 2021 12:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DCF71783C; Thu, 24 Jun 2021 12:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15OC7oJE032836; Thu, 24 Jun 2021 12:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15OC7oI6032835; Thu, 24 Jun 2021 12:07:50 GMT (envelope-from git) Date: Thu, 24 Jun 2021 12:07:50 GMT Message-Id: <202106241207.15OC7oI6032835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 2e6fec416d03 - stable/12 - tests/netgraph: Fix build error due to missing directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2e6fec416d0398598be15df9a3b713ac74c5d1e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 12:07:50 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=2e6fec416d0398598be15df9a3b713ac74c5d1e8 commit 2e6fec416d0398598be15df9a3b713ac74c5d1e8 Author: Lutz Donnerhacke AuthorDate: 2021-06-24 11:54:54 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-24 12:06:49 +0000 tests/netgraph: Fix build error due to missing directory While MFCing the tests into stable/11 the test directory needs to be added, because earlier netgraph tests were not MFCed to this train. PR: 256773 Reported by: Arrigo Marchiori Submitted by: Arrigo Marchiori Tested by: Arrigo Marchiori This is a direct commit into the stable/12 branch. --- etc/mtree/BSD.tests.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 325339d371f0..df03a6375779 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -788,6 +788,8 @@ .. net .. + netgraph + .. netinet .. netinet6 From owner-dev-commits-src-branches@freebsd.org Thu Jun 24 13:06:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 0848F64C076; Thu, 24 Jun 2021 13:06:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9gPz6cWZz4T0F; Thu, 24 Jun 2021 13:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCC1C18789; Thu, 24 Jun 2021 13:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15OD6la6013293; Thu, 24 Jun 2021 13:06:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15OD6ljV013292; Thu, 24 Jun 2021 13:06:47 GMT (envelope-from git) Date: Thu, 24 Jun 2021 13:06:47 GMT Message-Id: <202106241306.15OD6ljV013292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1bf7ee1ab5df - stable/13 - dtrace: fix an out of bound read and a NULL pointer increment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1bf7ee1ab5df1c0b8083f8f3b63037c1d72af387 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 13:06:48 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1bf7ee1ab5df1c0b8083f8f3b63037c1d72af387 commit 1bf7ee1ab5df1c0b8083f8f3b63037c1d72af387 Author: Domagoj Stolfa AuthorDate: 2021-06-17 17:35:33 +0000 Commit: Mark Johnston CommitDate: 2021-06-24 13:04:54 +0000 dtrace: fix an out of bound read and a NULL pointer increment In dt_cc.c when the provider is an empty string, accessing strlen(pdp->dtpd_provider) - 1 will result in a pdp->dtpd_provider[-1] access. Similarly, in dt_ident.c, if p2 is a NULL pointer, doing a p2++ on it is undefined behaviour. Reviewed by: markj Sponsored by: Google (cherry picked from commit a877965fa3da218bceaaa0f51c4d7770e64e6df0) --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c | 6 +++++- cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c index 8ec5dd61b8ee..e63771c91e08 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c @@ -1691,6 +1691,7 @@ dt_setcontext(dtrace_hdl_t *dtp, dtrace_probedesc_t *pdp) dt_ident_t *idp; char attrstr[8]; int err; + size_t prov_len; /* * Both kernel and pid based providers are allowed to have names @@ -1704,7 +1705,10 @@ dt_setcontext(dtrace_hdl_t *dtp, dtrace_probedesc_t *pdp) * On an error, dt_pid_create_probes() will set the error message * and tag -- we just have to longjmp() out of here. */ - if (isdigit(pdp->dtpd_provider[strlen(pdp->dtpd_provider) - 1]) && + + prov_len = strlen(pdp->dtpd_provider); + + if ((prov_len > 0 && isdigit(pdp->dtpd_provider[prov_len - 1])) && ((pvp = dt_provider_lookup(dtp, pdp->dtpd_provider)) == NULL || pvp->pv_desc.dtvd_priv.dtpp_flags & DTRACE_PRIV_PROC) && dt_pid_create_probes(pdp, dtp, yypcb) != 0) { diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c index b9164ac26cf9..5ff772be041d 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c @@ -210,8 +210,10 @@ dt_idcook_func(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args) } } - for (p2 = strchr(p2, ','); p2++ != NULL; i++) + for (p2 = strchr(p2, ','); p2 != NULL; i++) { + p2++; p2 = strchr(p2, ','); + } /* * We first allocate a new ident signature structure with the From owner-dev-commits-src-branches@freebsd.org Thu Jun 24 17:51:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 46E20651D1E; Thu, 24 Jun 2021 17:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9nkz1b9Dz3D39; Thu, 24 Jun 2021 17:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F1811BDF9; Thu, 24 Jun 2021 17:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15OHpta5095240; Thu, 24 Jun 2021 17:51:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15OHptPX095239; Thu, 24 Jun 2021 17:51:55 GMT (envelope-from git) Date: Thu, 24 Jun 2021 17:51:55 GMT Message-Id: <202106241751.15OHptPX095239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: 6e2623c012c3 - stable/13 - jail: Don't allow substitution of valueless jail parameters. PR: 256544 Reported by: cryptogranny at gmail.com MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6e2623c012c3a704ad00b92e8114635845801bb7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 17:51:55 -0000 The branch stable/13 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=6e2623c012c3a704ad00b92e8114635845801bb7 commit 6e2623c012c3a704ad00b92e8114635845801bb7 Author: Jamie Gritton AuthorDate: 2021-06-18 16:44:37 +0000 Commit: Jamie Gritton CommitDate: 2021-06-24 17:51:27 +0000 jail: Don't allow substitution of valueless jail parameters. PR: 256544 Reported by: cryptogranny at gmail.com (cherry picked from commit 5bf6dca2c6dbf63d382e97905e205ded3e8525d2) --- usr.sbin/jail/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c index e6ebc585bcd7..4cf28820452a 100644 --- a/usr.sbin/jail/config.c +++ b/usr.sbin/jail/config.c @@ -198,7 +198,7 @@ load_config(void) TAILQ_FOREACH(vp, &j->params, tq) if (!strcmp(vp->name, v->name)) break; - if (!vp) { + if (!vp || TAILQ_EMPTY(&vp->val)) { jail_warnx(j, "%s: variable \"%s\" not found", p->name, v->name); From owner-dev-commits-src-branches@freebsd.org Thu Jun 24 17:53:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 6EC34651EB4; Thu, 24 Jun 2021 17:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9nmv2l88z3D8f; Thu, 24 Jun 2021 17:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 465B51C53C; Thu, 24 Jun 2021 17:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15OHrZ9r099320; Thu, 24 Jun 2021 17:53:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15OHrZxQ099319; Thu, 24 Jun 2021 17:53:35 GMT (envelope-from git) Date: Thu, 24 Jun 2021 17:53:35 GMT Message-Id: <202106241753.15OHrZxQ099319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: ade910f43b70 - stable/12 - jail: Don't allow substitution of valueless jail parameters. PR: 256544 Reported by: cryptogranny at gmail.com MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ade910f43b70b0ced99a2c31bd965a5637caf320 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 17:53:35 -0000 The branch stable/12 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=ade910f43b70b0ced99a2c31bd965a5637caf320 commit ade910f43b70b0ced99a2c31bd965a5637caf320 Author: Jamie Gritton AuthorDate: 2021-06-18 16:44:37 +0000 Commit: Jamie Gritton CommitDate: 2021-06-24 17:53:24 +0000 jail: Don't allow substitution of valueless jail parameters. PR: 256544 Reported by: cryptogranny at gmail.com (cherry picked from commit 5bf6dca2c6dbf63d382e97905e205ded3e8525d2) --- usr.sbin/jail/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c index a54127950206..4a37ee9fbecf 100644 --- a/usr.sbin/jail/config.c +++ b/usr.sbin/jail/config.c @@ -198,7 +198,7 @@ load_config(void) TAILQ_FOREACH(vp, &j->params, tq) if (!strcmp(vp->name, v->name)) break; - if (!vp) { + if (!vp || TAILQ_EMPTY(&vp->val)) { jail_warnx(j, "%s: variable \"%s\" not found", p->name, v->name); From owner-dev-commits-src-branches@freebsd.org Thu Jun 24 17:54:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 B2032651EBE; Thu, 24 Jun 2021 17:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9nnk4hFSz3DP5; Thu, 24 Jun 2021 17:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 896871C46E; Thu, 24 Jun 2021 17:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15OHsI43099484; Thu, 24 Jun 2021 17:54:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15OHsIt9099483; Thu, 24 Jun 2021 17:54:18 GMT (envelope-from git) Date: Thu, 24 Jun 2021 17:54:18 GMT Message-Id: <202106241754.15OHsIt9099483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: 75befde07bdf - stable/11 - jail: Don't allow substitution of valueless jail parameters. PR: 256544 Reported by: cryptogranny at gmail.com MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 75befde07bdf1e3059c8c5e8928a695e5e59d698 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 17:54:18 -0000 The branch stable/11 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=75befde07bdf1e3059c8c5e8928a695e5e59d698 commit 75befde07bdf1e3059c8c5e8928a695e5e59d698 Author: Jamie Gritton AuthorDate: 2021-06-18 16:44:37 +0000 Commit: Jamie Gritton CommitDate: 2021-06-24 17:54:00 +0000 jail: Don't allow substitution of valueless jail parameters. PR: 256544 Reported by: cryptogranny at gmail.com (cherry picked from commit 5bf6dca2c6dbf63d382e97905e205ded3e8525d2) --- usr.sbin/jail/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c index cb353ed4563e..554779e84720 100644 --- a/usr.sbin/jail/config.c +++ b/usr.sbin/jail/config.c @@ -196,7 +196,7 @@ load_config(void) TAILQ_FOREACH(vp, &j->params, tq) if (!strcmp(vp->name, v->name)) break; - if (!vp) { + if (!vp || TAILQ_EMPTY(&vp->val)) { jail_warnx(j, "%s: variable \"%s\" not found", p->name, v->name); From owner-dev-commits-src-branches@freebsd.org Thu Jun 24 23:43:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 14A48656139; Thu, 24 Jun 2021 23:43:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9xXp73PBz4YF9; Thu, 24 Jun 2021 23:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAA9D20F63; Thu, 24 Jun 2021 23:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ONhcg0064689; Thu, 24 Jun 2021 23:43:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ONhcZ1064688; Thu, 24 Jun 2021 23:43:38 GMT (envelope-from git) Date: Thu, 24 Jun 2021 23:43:38 GMT Message-Id: <202106242343.15ONhcZ1064688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 9d61599983db - stable/13 - Consolidate machine/endian.h definitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9d61599983dbc3e43a4eb5b0e87276afbc1be257 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 23:43:39 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9d61599983dbc3e43a4eb5b0e87276afbc1be257 commit 9d61599983dbc3e43a4eb5b0e87276afbc1be257 Author: Mitchell Horne AuthorDate: 2021-03-01 15:07:54 +0000 Commit: Mitchell Horne CommitDate: 2021-06-24 23:42:56 +0000 Consolidate machine/endian.h definitions This change serves two purposes. First, we take advantage of the compiler provided endian definitions to eliminate some long-standing duplication between the different versions of this header. __BYTE_ORDER__ has been defined since GCC 4.6, so there is no need to rely on platform defaults or e.g. __MIPSEB__ to determine endianness. A new common sub-header is added, but there should be no changes to the visibility of these definitions. Second, this eliminates the hand-rolled __bswapNN() routines, again in favor of the compiler builtins. This was done already for x86 in e6ff6154d203. The benefit here is that we no longer have to maintain our own implementations on each arch, and can instead rely on the compiler to emit appropriate instructions or libcalls, as available. This should result in equivalent or better code generation. Notably 32-bit arm will start using the `rev` instruction for these routines, which is available on armv6+. PR: 236920 Reviewed by: arichardson, imp Tested by: bdragon (BE powerpc) MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D29012 (cherry picked from commit 720dc6bcb5a8c4283802576e2ef54f42b33fa8d4) --- sys/arm/include/endian.h | 109 ++----------------------------------------- sys/arm64/include/endian.h | 85 +-------------------------------- sys/mips/include/endian.h | 106 +---------------------------------------- sys/powerpc/include/endian.h | 102 +--------------------------------------- sys/riscv/include/endian.h | 87 +--------------------------------- sys/sys/_endian.h | 92 ++++++++++++++++++++++++++++++++++++ sys/x86/include/endian.h | 38 +-------------- 7 files changed, 101 insertions(+), 518 deletions(-) diff --git a/sys/arm/include/endian.h b/sys/arm/include/endian.h index 5fb94db3b9b8..eb3f0d142322 100644 --- a/sys/arm/include/endian.h +++ b/sys/arm/include/endian.h @@ -32,111 +32,10 @@ * $FreeBSD$ */ -#ifndef _ENDIAN_H_ -#define _ENDIAN_H_ +#ifndef _MACHINE_ENDIAN_H_ +#define _MACHINE_ENDIAN_H_ #include +#include -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#ifdef __ARMEB__ -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif /* __ARMEB__ */ - -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#ifdef __ARMEB__ -#define _QUAD_HIGHWORD 0 -#define _QUAD_LOWWORD 1 -#define __ntohl(x) ((__uint32_t)(x)) -#define __ntohs(x) ((__uint16_t)(x)) -#define __htonl(x) ((__uint32_t)(x)) -#define __htons(x) ((__uint16_t)(x)) -#else -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#define __ntohl(x) (__bswap32(x)) -#define __ntohs(x) (__bswap16(x)) -#define __htonl(x) (__bswap32(x)) -#define __htons(x) (__bswap16(x)) -#endif /* __ARMEB__ */ - -static __inline __uint64_t -__bswap64(__uint64_t _x) -{ - - return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | - ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | - ((_x << 24) & ((__uint64_t)0xff << 40)) | - ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t v) -{ - __uint32_t t1; - - __asm __volatile("eor %1, %0, %0, ror #16\n" - "bic %1, %1, #0x00ff0000\n" - "mov %0, %0, ror #8\n" - "eor %0, %0, %1, lsr #8\n" - : "+r" (v), "=r" (t1)); - - return (v); -} - -static __inline __uint16_t -__bswap16_var(__uint16_t v) -{ - __uint32_t ret = v & 0xffff; - - __asm __volatile( - "mov %0, %0, ror #8\n" - "orr %0, %0, %0, lsr #16\n" - "bic %0, %0, %0, lsl #16" - : "+r" (ret)); - - return ((__uint16_t)ret); -} - -#ifdef __OPTIMIZE__ - -#define __bswap32_constant(x) \ - ((((x) & 0xff000000U) >> 24) | \ - (((x) & 0x00ff0000U) >> 8) | \ - (((x) & 0x0000ff00U) << 8) | \ - (((x) & 0x000000ffU) << 24)) - -#define __bswap16_constant(x) \ - ((((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8)) - -#define __bswap16(x) \ - ((__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_constant(x) : \ - __bswap16_var(x))) - -#define __bswap32(x) \ - ((__uint32_t)(__builtin_constant_p(x) ? \ - __bswap32_constant(x) : \ - __bswap32_var(x))) - -#else -#define __bswap16(x) __bswap16_var(x) -#define __bswap32(x) __bswap32_var(x) - -#endif /* __OPTIMIZE__ */ -#endif /* !_ENDIAN_H_ */ +#endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/arm64/include/endian.h b/sys/arm64/include/endian.h index 8cb5c6976b37..0f06010b7e4b 100644 --- a/sys/arm64/include/endian.h +++ b/sys/arm64/include/endian.h @@ -34,89 +34,6 @@ #define _MACHINE_ENDIAN_H_ #include +#include -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#define _BYTE_ORDER _LITTLE_ENDIAN - -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#define __ntohl(x) (__bswap32(x)) -#define __ntohs(x) (__bswap16(x)) -#define __htonl(x) (__bswap32(x)) -#define __htons(x) (__bswap16(x)) - -static __inline __uint64_t -__bswap64(__uint64_t x) -{ - __uint64_t ret; - - __asm __volatile("rev %0, %1\n" - : "=&r" (ret), "+r" (x)); - - return (ret); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t v) -{ - __uint32_t ret; - - __asm __volatile("rev32 %x0, %x1\n" - : "=&r" (ret), "+r" (v)); - - return (ret); -} - -static __inline __uint16_t -__bswap16_var(__uint16_t v) -{ - __uint32_t ret; - - __asm __volatile("rev16 %w0, %w1\n" - : "=&r" (ret), "+r" (v)); - - return ((__uint16_t)ret); -} - -#ifdef __OPTIMIZE__ - -#define __bswap32_constant(x) \ - ((((x) & 0xff000000U) >> 24) | \ - (((x) & 0x00ff0000U) >> 8) | \ - (((x) & 0x0000ff00U) << 8) | \ - (((x) & 0x000000ffU) << 24)) - -#define __bswap16_constant(x) \ - ((((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8)) - -#define __bswap16(x) \ - ((__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_constant((__uint16_t)(x)) : \ - __bswap16_var(x))) - -#define __bswap32(x) \ - ((__uint32_t)(__builtin_constant_p(x) ? \ - __bswap32_constant((__uint32_t)(x)) : \ - __bswap32_var(x))) - -#else -#define __bswap16(x) __bswap16_var(x) -#define __bswap32(x) __bswap32_var(x) - -#endif /* __OPTIMIZE__ */ #endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/mips/include/endian.h b/sys/mips/include/endian.h index 9faf60e9667f..57f76445a9cd 100644 --- a/sys/mips/include/endian.h +++ b/sys/mips/include/endian.h @@ -39,110 +39,6 @@ #ifndef __ASSEMBLER__ #include #endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#ifdef __MIPSEB__ -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif /* __MIBSEB__ */ - -/* - * Deprecated variants that don't have enough underscores to be useful in more - * strict namespaces. - */ -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#ifndef __ASSEMBLER__ -#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) && defined(__OPTIMIZE__) -#define __is_constant(x) __builtin_constant_p(x) -#else -#define __is_constant(x) 0 -#endif - -#define __bswap16_const(x) (((x) >> 8) | (((x) << 8) & 0xff00)) -#define __bswap32_const(x) (((x) >> 24) | (((x) >> 8) & 0xff00) | \ - (((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000)) -#define __bswap64_const(x) (((x) >> 56) | (((x) >> 40) & 0xff00) | \ - (((x) >> 24) & 0xff0000) | (((x) >> 8) & 0xff000000) | \ - (((x) << 8) & ((__uint64_t)0xff << 32)) | \ - (((x) << 24) & ((__uint64_t)0xff << 40)) | \ - (((x) << 40) & ((__uint64_t)0xff << 48)) | (((x) << 56))) - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return ((_x >> 8) | ((_x << 8) & 0xff00)); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - - return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) | - ((_x << 24) & 0xff000000)); -} - -static __inline __uint64_t -__bswap64_var(__uint64_t _x) -{ - - return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | - ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | - ((_x << 24) & ((__uint64_t)0xff << 40)) | - ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); -} - -#define __bswap16(x) ((__uint16_t)(__is_constant((x)) ? \ - __bswap16_const((__uint16_t)(x)) : __bswap16_var((__uint16_t)(x)))) -#define __bswap32(x) ((__uint32_t)(__is_constant((x)) ? \ - __bswap32_const((__uint32_t)(x)) : __bswap32_var((__uint32_t)(x)))) -#define __bswap64(x) ((__uint64_t)(__is_constant((x)) ? \ - __bswap64_const((__uint64_t)(x)) : __bswap64_var((__uint64_t)(x)))) - -#ifdef __MIPSEB__ -#define __htonl(x) ((__uint32_t)(x)) -#define __htons(x) ((__uint16_t)(x)) -#define __ntohl(x) ((__uint32_t)(x)) -#define __ntohs(x) ((__uint16_t)(x)) -/* - * Define the order of 32-bit words in 64-bit words. - */ -/* - * XXXMIPS: Additional parentheses to make gcc more happy. - */ -#define _QUAD_HIGHWORD 0 -#define _QUAD_LOWWORD 1 -#else -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#define __ntohl(x) (__bswap32((x))) -#define __ntohs(x) (__bswap16((x))) -#define __htonl(x) (__bswap32((x))) -#define __htons(x) (__bswap16((x))) -#endif /* _MIPSEB */ - -#endif /* _ASSEMBLER_ */ - -#ifdef __cplusplus -} -#endif +#include #endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/powerpc/include/endian.h b/sys/powerpc/include/endian.h index 8cbd7e024eb9..9e28237bfd24 100644 --- a/sys/powerpc/include/endian.h +++ b/sys/powerpc/include/endian.h @@ -35,20 +35,8 @@ #ifndef _MACHINE_ENDIAN_H_ #define _MACHINE_ENDIAN_H_ -#include #include -/* - * Define the order of 32-bit words in 64-bit words. - */ -#ifdef __LITTLE_ENDIAN__ -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#else -#define _QUAD_HIGHWORD 0 -#define _QUAD_LOWWORD 1 -#endif - /* * GCC defines _BIG_ENDIAN and _LITTLE_ENDIAN equal to __BIG_ENDIAN__ * and __LITTLE_ENDIAN__ (resp). @@ -60,94 +48,6 @@ #undef _LITTLE_ENDIAN #endif -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#ifdef __LITTLE_ENDIAN__ -#define _BYTE_ORDER _LITTLE_ENDIAN -#else -#define _BYTE_ORDER _BIG_ENDIAN -#endif - -/* - * Deprecated variants that don't have enough underscores to be useful in more - * strict namespaces. - */ -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) -#define __is_constant(x) __builtin_constant_p(x) -#else -#define __is_constant(x) 0 -#endif - -#define __bswap16_const(x) ((((__uint16_t)(x) >> 8) & 0xff) | \ - (((__uint16_t)(x) << 8) & 0xff00)) -#define __bswap32_const(x) ((((__uint32_t)(x) >> 24) & 0xff) | \ - (((__uint32_t)(x) >> 8) & 0xff00) | \ - (((__uint32_t)(x)<< 8) & 0xff0000) | \ - (((__uint32_t)(x) << 24) & 0xff000000)) -#define __bswap64_const(x) ((((__uint64_t)(x) >> 56) & 0xff) | \ - (((__uint64_t)(x) >> 40) & 0xff00) | \ - (((__uint64_t)(x) >> 24) & 0xff0000) | \ - (((__uint64_t)(x) >> 8) & 0xff000000) | \ - (((__uint64_t)(x) << 8) & ((__uint64_t)0xff << 32)) | \ - (((__uint64_t)(x) << 24) & ((__uint64_t)0xff << 40)) | \ - (((__uint64_t)(x) << 40) & ((__uint64_t)0xff << 48)) | \ - (((__uint64_t)(x) << 56) & ((__uint64_t)0xff << 56))) - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return ((_x >> 8) | ((_x << 8) & 0xff00)); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - - return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) | - ((_x << 24) & 0xff000000)); -} - -static __inline __uint64_t -__bswap64_var(__uint64_t _x) -{ - - return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | - ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | - ((_x << 24) & ((__uint64_t)0xff << 40)) | - ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); -} - -#define __bswap16(x) ((__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \ - __bswap16_var(x))) -#define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \ - __bswap32_var(x)) -#define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \ - __bswap64_var(x)) - -#ifdef __LITTLE_ENDIAN__ -#define __htonl(x) (__bswap32((__uint32_t)(x))) -#define __htons(x) (__bswap16((__uint16_t)(x))) -#define __ntohl(x) (__bswap32((__uint32_t)(x))) -#define __ntohs(x) (__bswap16((__uint16_t)(x))) -#else -#define __htonl(x) ((__uint32_t)(x)) -#define __htons(x) ((__uint16_t)(x)) -#define __ntohl(x) ((__uint32_t)(x)) -#define __ntohs(x) ((__uint16_t)(x)) -#endif +#include #endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/riscv/include/endian.h b/sys/riscv/include/endian.h index 25516fa01366..0f06010b7e4b 100644 --- a/sys/riscv/include/endian.h +++ b/sys/riscv/include/endian.h @@ -34,91 +34,6 @@ #define _MACHINE_ENDIAN_H_ #include +#include -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#define _BYTE_ORDER _LITTLE_ENDIAN - -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#define __ntohl(x) (__bswap32(x)) -#define __ntohs(x) (__bswap16(x)) -#define __htonl(x) (__bswap32(x)) -#define __htons(x) (__bswap16(x)) - -static __inline __uint64_t -__bswap64(__uint64_t _x) -{ - __uint64_t ret; - - ret = (_x >> 56); - ret |= ((_x >> 40) & 0xff00); - ret |= ((_x >> 24) & 0xff0000); - ret |= ((_x >> 8) & 0xff000000); - ret |= ((_x << 8) & ((__uint64_t)0xff << 32)); - ret |= ((_x << 24) & ((__uint64_t)0xff << 40)); - ret |= ((_x << 40) & ((__uint64_t)0xff << 48)); - ret |= (_x << 56); - - return (ret); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - - return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) | - ((_x << 24) & 0xff000000)); -} - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - __uint32_t ret; - - ret = ((_x >> 8) | ((_x << 8) & 0xff00)); - - return ((__uint16_t)ret); -} - -#ifdef __OPTIMIZE__ - -#define __bswap32_constant(x) \ - ((((x) & 0xff000000U) >> 24) | \ - (((x) & 0x00ff0000U) >> 8) | \ - (((x) & 0x0000ff00U) << 8) | \ - (((x) & 0x000000ffU) << 24)) - -#define __bswap16_constant(x) \ - ((((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8)) - -#define __bswap16(x) \ - ((__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_constant(x) : \ - __bswap16_var(x))) - -#define __bswap32(x) \ - ((__uint32_t)(__builtin_constant_p(x) ? \ - __bswap32_constant(x) : \ - __bswap32_var(x))) - -#else -#define __bswap16(x) __bswap16_var(x) -#define __bswap32(x) __bswap32_var(x) - -#endif /* __OPTIMIZE__ */ #endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/sys/_endian.h b/sys/sys/_endian.h new file mode 100644 index 000000000000..936962cc729f --- /dev/null +++ b/sys/sys/_endian.h @@ -0,0 +1,92 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1987, 1991 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS__ENDIAN_H_ +#define _SYS__ENDIAN_H_ + +#ifndef _MACHINE_ENDIAN_H_ +#error "sys/_endian.h should not be included directly" +#endif + +/* BSD Compatiblity */ +#define _BYTE_ORDER __BYTE_ORDER__ + +/* + * Definitions for byte order, according to byte significance from low + * address to high. + */ +#define _LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ /* LSB first: 1234 */ +#define _BIG_ENDIAN __ORDER_BIG_ENDIAN__ /* MSB first: 4321 */ +#define _PDP_ENDIAN __ORDER_PDP_ENDIAN__ /* LSB first in word, + * MSW first in long: 3412 */ + +/* + * Define the order of 32-bit words in 64-bit words. + */ +#if _BYTE_ORDER == _LITTLE_ENDIAN +#define _QUAD_HIGHWORD 1 +#define _QUAD_LOWWORD 0 +#elif _BYTE_ORDER == _BIG_ENDIAN +#define _QUAD_HIGHWORD 0 +#define _QUAD_LOWWORD 1 +#else +#error "Unsupported endian" +#endif + +/* + * Deprecated variants that don't have enough underscores to be useful in more + * strict namespaces. + */ +#if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER +#endif + +/* bswap primitives, based on compiler builtins */ +#define __bswap16(x) __builtin_bswap16(x) +#define __bswap32(x) __builtin_bswap32(x) +#define __bswap64(x) __builtin_bswap64(x) + +#if _BYTE_ORDER == _LITTLE_ENDIAN +#define __ntohl(x) (__bswap32(x)) +#define __ntohs(x) (__bswap16(x)) +#define __htonl(x) (__bswap32(x)) +#define __htons(x) (__bswap16(x)) +#elif _BYTE_ORDER == _BIG_ENDIAN +#define __htonl(x) ((__uint32_t)(x)) +#define __htons(x) ((__uint16_t)(x)) +#define __ntohl(x) ((__uint32_t)(x)) +#define __ntohs(x) ((__uint16_t)(x)) +#endif + +#endif /* _SYS__ENDIAN_H_ */ diff --git a/sys/x86/include/endian.h b/sys/x86/include/endian.h index 18d52fb8a6fa..8fb24881145b 100644 --- a/sys/x86/include/endian.h +++ b/sys/x86/include/endian.h @@ -35,43 +35,7 @@ #ifndef _MACHINE_ENDIAN_H_ #define _MACHINE_ENDIAN_H_ -#include #include - -/* - * Define the order of 32-bit words in 64-bit words. - */ -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 - -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#define _BYTE_ORDER _LITTLE_ENDIAN - -/* - * Deprecated variants that don't have enough underscores to be useful in more - * strict namespaces. - */ -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#define __bswap16(x) __builtin_bswap16(x) -#define __bswap32(x) __builtin_bswap32(x) -#define __bswap64(x) __builtin_bswap64(x) - -#define __htonl(x) __bswap32(x) -#define __htons(x) __bswap16(x) -#define __ntohl(x) __bswap32(x) -#define __ntohs(x) __bswap16(x) +#include #endif /* !_MACHINE_ENDIAN_H_ */ From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 17:32:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 8D5E7667B9A; Fri, 25 Jun 2021 17:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBPG33Wylz4r2C; Fri, 25 Jun 2021 17:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6186072F9; Fri, 25 Jun 2021 17:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PHWRQk098896; Fri, 25 Jun 2021 17:32:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PHWRJK098895; Fri, 25 Jun 2021 17:32:27 GMT (envelope-from git) Date: Fri, 25 Jun 2021 17:32:27 GMT Message-Id: <202106251732.15PHWRJK098895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 1ed4655d9d5a - stable/13 - Fix clang assertion while building recent www/chromium MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1ed4655d9d5aab333eb5a89fafc2080315a0af79 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 17:32:27 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1ed4655d9d5aab333eb5a89fafc2080315a0af79 commit 1ed4655d9d5aab333eb5a89fafc2080315a0af79 Author: Dimitry Andric AuthorDate: 2021-06-21 18:46:34 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 17:30:41 +0000 Fix clang assertion while building recent www/chromium Merge commit c8227f06b335 from llvm git (by Arthur Eubanks): [clang] Don't assert in EmitAggregateCopy on trivial_abi types Fixes PR42961. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D97872 PR: 256721, 255570 Reported by: jbeich (cherry picked from commit e7e517981a6591c79fb49cd8810361b0f3ad5983) --- contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp index fb96d70732e8..ee1c71a5452e 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp @@ -1939,7 +1939,7 @@ void CodeGenFunction::EmitAggregateCopy(LValue Dest, LValue Src, QualType Ty, Record->hasTrivialCopyAssignment() || Record->hasTrivialMoveConstructor() || Record->hasTrivialMoveAssignment() || - Record->isUnion()) && + Record->hasAttr() || Record->isUnion()) && "Trying to aggregate-copy a type without a trivial copy/move " "constructor or assignment operator"); // Ignore empty classes in C++. From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 17:32:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 BB4506671F8; Fri, 25 Jun 2021 17:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBPG44Z3Rz4r4F; Fri, 25 Jun 2021 17:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FFAB7795; Fri, 25 Jun 2021 17:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PHWS95098927; Fri, 25 Jun 2021 17:32:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PHWSRf098925; Fri, 25 Jun 2021 17:32:28 GMT (envelope-from git) Date: Fri, 25 Jun 2021 17:32:28 GMT Message-Id: <202106251732.15PHWSRf098925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: d4c94bcca41f - stable/13 - Disable llvm generating 128-bit multiply libcalls on 32-bit ARM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d4c94bcca41ff61984b5bfb65f1cb5e9798631e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 17:32:29 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d4c94bcca41ff61984b5bfb65f1cb5e9798631e8 commit d4c94bcca41ff61984b5bfb65f1cb5e9798631e8 Author: Dimitry Andric AuthorDate: 2021-06-22 20:26:13 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 17:30:47 +0000 Disable llvm generating 128-bit multiply libcalls on 32-bit ARM Merge commit 789708617d20 from llvm git (Koutheir Attouchi): Do not generate calls to the 128-bit function __multi3() on 32-bit ARM Re-applying this patch after bots failures. Should be fine now. The function __multi3() is undefined on 32-bit ARM, so a call to it should never be emitted. Instead, plain instructions need to be generated to perform 128-bit multiplications. Differential Revision: https://reviews.llvm.org/D103906 Reported by: mmel (cherry picked from commit 014a40f8f643a5dad6a6ba5c4bf6ea5d4f445fe6) --- contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp index 287e2e60e572..7bad485e390c 100644 --- a/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -534,6 +534,7 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM, setLibcallName(RTLIB::SHL_I128, nullptr); setLibcallName(RTLIB::SRL_I128, nullptr); setLibcallName(RTLIB::SRA_I128, nullptr); + setLibcallName(RTLIB::MUL_I128, nullptr); // RTLIB if (Subtarget->isAAPCS_ABI() && From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 17:32:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 16044667A2D; Fri, 25 Jun 2021 17:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBPG56G1Jz4r2H; Fri, 25 Jun 2021 17:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B25427797; Fri, 25 Jun 2021 17:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PHWTHk098951; Fri, 25 Jun 2021 17:32:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PHWTkh098950; Fri, 25 Jun 2021 17:32:29 GMT (envelope-from git) Date: Fri, 25 Jun 2021 17:32:29 GMT Message-Id: <202106251732.15PHWTkh098950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 856f1fd6c360 - stable/13 - Fix failures in libm's lround_test after clang 12 import MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 856f1fd6c3607e1b77c97ca6830f230b876d2bce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 17:32:30 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=856f1fd6c3607e1b77c97ca6830f230b876d2bce commit 856f1fd6c3607e1b77c97ca6830f230b876d2bce Author: Dimitry Andric AuthorDate: 2021-06-22 16:38:27 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 17:30:50 +0000 Fix failures in libm's lround_test after clang 12 import It turned out that the (type)DTYPE_MAX conversions at the top of s_lround.c are now emitted as cvtsi2sd instructions, at least on SSE capable CPUs. This caused the FE_INEXACT flag to always be set, at least for the double and float variants. Under clang 11, the whole INRANGE() comparisons were still optimized away, but this has "improved" in clang 12, due to stricter adherence to the -ffp-exception-behavior=maytrap compiler flag. To avoid run-time integer to float conversions, use static constants instead, so they are computed at compile time, and the INRANGE() statements are optimized away again, if applicable. While here, use an integer instead of a floating type to store the test results in lround_test.c, as this is more appropriate, and we can also drop the volatile hack. Reported by: arichardson (cherry picked from commit df3b437c1e073eb83e9a93af1c417f3ee8d0de3b) --- lib/msun/src/s_lround.c | 8 +++++--- lib/msun/tests/lround_test.c | 7 +------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/msun/src/s_lround.c b/lib/msun/src/s_lround.c index 66d9183a74bc..c4d305401ac8 100644 --- a/lib/msun/src/s_lround.c +++ b/lib/msun/src/s_lround.c @@ -49,9 +49,11 @@ __FBSDID("$FreeBSD$"); * that everything is in range. At compile time, INRANGE(x) should reduce to * two floating-point comparisons in the former case, or TRUE otherwise. */ -static const type dtype_min = (type)DTYPE_MIN - 0.5; -static const type dtype_max = (type)DTYPE_MAX + 0.5; -#define INRANGE(x) (dtype_max - (type)DTYPE_MAX != 0.5 || \ +static const type type_min = (type)DTYPE_MIN; +static const type type_max = (type)DTYPE_MAX; +static const type dtype_min = type_min - 0.5; +static const type dtype_max = type_max + 0.5; +#define INRANGE(x) (dtype_max - type_max != 0.5 || \ ((x) > dtype_min && (x) < dtype_max)) dtype diff --git a/lib/msun/tests/lround_test.c b/lib/msun/tests/lround_test.c index a6daa5459c7b..ddb2b2cea9b3 100644 --- a/lib/msun/tests/lround_test.c +++ b/lib/msun/tests/lround_test.c @@ -40,14 +40,9 @@ __FBSDID("$FreeBSD$"); #define IGNORE 0x12345 -/* - * XXX The volatile here is to avoid gcc's bogus constant folding and work - * around the lack of support for the FENV_ACCESS pragma. - */ #define test(func, x, result, excepts) do { \ - volatile double _d = x; \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - volatile double _r = (func)(_d); \ + long long _r = (func)(x); \ CHECK_FP_EXCEPTIONS_MSG(excepts, FE_ALL_EXCEPT, "for %s(%s)", \ #func, #x); \ if ((excepts & FE_INVALID) != 0) { \ From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 17:33:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 17DCA667C87; Fri, 25 Jun 2021 17:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBPGh08hPz4rPd; Fri, 25 Jun 2021 17:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E13AB779A; Fri, 25 Jun 2021 17:32:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PHWxYv099151; Fri, 25 Jun 2021 17:32:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PHWxns099150; Fri, 25 Jun 2021 17:32:59 GMT (envelope-from git) Date: Fri, 25 Jun 2021 17:32:59 GMT Message-Id: <202106251732.15PHWxns099150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 858dc467c63c - stable/12 - Fix clang assertion while building recent www/chromium MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 858dc467c63c1be107808bcef9198591416ac71c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 17:33:00 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=858dc467c63c1be107808bcef9198591416ac71c commit 858dc467c63c1be107808bcef9198591416ac71c Author: Dimitry Andric AuthorDate: 2021-06-21 18:46:34 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 17:31:22 +0000 Fix clang assertion while building recent www/chromium Merge commit c8227f06b335 from llvm git (by Arthur Eubanks): [clang] Don't assert in EmitAggregateCopy on trivial_abi types Fixes PR42961. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D97872 PR: 256721, 255570 Reported by: jbeich (cherry picked from commit e7e517981a6591c79fb49cd8810361b0f3ad5983) --- contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp index 8de609a2ccd9..53dbfecfc538 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp @@ -1914,7 +1914,7 @@ void CodeGenFunction::EmitAggregateCopy(LValue Dest, LValue Src, QualType Ty, Record->hasTrivialCopyAssignment() || Record->hasTrivialMoveConstructor() || Record->hasTrivialMoveAssignment() || - Record->isUnion()) && + Record->hasAttr() || Record->isUnion()) && "Trying to aggregate-copy a type without a trivial copy/move " "constructor or assignment operator"); // Ignore empty classes in C++. From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 17:33:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 3CB7366797A; Fri, 25 Jun 2021 17:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBPGj19s2z4rHW; Fri, 25 Jun 2021 17:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EFA8776B; Fri, 25 Jun 2021 17:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PHX0UK099190; Fri, 25 Jun 2021 17:33:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PHX0Ko099189; Fri, 25 Jun 2021 17:33:00 GMT (envelope-from git) Date: Fri, 25 Jun 2021 17:33:00 GMT Message-Id: <202106251733.15PHX0Ko099189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 1adf1b31582d - stable/12 - Disable llvm generating 128-bit multiply libcalls on 32-bit ARM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1adf1b31582d9c311ff9166994bd6e4db7fb7e9e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 17:33:01 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1adf1b31582d9c311ff9166994bd6e4db7fb7e9e commit 1adf1b31582d9c311ff9166994bd6e4db7fb7e9e Author: Dimitry Andric AuthorDate: 2021-06-22 20:26:13 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 17:31:27 +0000 Disable llvm generating 128-bit multiply libcalls on 32-bit ARM Merge commit 789708617d20 from llvm git (Koutheir Attouchi): Do not generate calls to the 128-bit function __multi3() on 32-bit ARM Re-applying this patch after bots failures. Should be fine now. The function __multi3() is undefined on 32-bit ARM, so a call to it should never be emitted. Instead, plain instructions need to be generated to perform 128-bit multiplications. Differential Revision: https://reviews.llvm.org/D103906 Reported by: mmel (cherry picked from commit 014a40f8f643a5dad6a6ba5c4bf6ea5d4f445fe6) --- contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp index 9f504b1eaa42..00e709292eb8 100644 --- a/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -511,6 +511,7 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM, setLibcallName(RTLIB::SHL_I128, nullptr); setLibcallName(RTLIB::SRL_I128, nullptr); setLibcallName(RTLIB::SRA_I128, nullptr); + setLibcallName(RTLIB::MUL_I128, nullptr); // RTLIB if (Subtarget->isAAPCS_ABI() && From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 17:33:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 82A9F667D08; Fri, 25 Jun 2021 17:33:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBPGk2mtZz4rCL; Fri, 25 Jun 2021 17:33:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 331747649; Fri, 25 Jun 2021 17:33:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PHX2gM099221; Fri, 25 Jun 2021 17:33:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PHX256099218; Fri, 25 Jun 2021 17:33:02 GMT (envelope-from git) Date: Fri, 25 Jun 2021 17:33:02 GMT Message-Id: <202106251733.15PHX256099218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 7356681c6c28 - stable/12 - Fix failures in libm's lround_test after clang 12 import MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7356681c6c28a02f29f529a353938707d312109e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 17:33:02 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=7356681c6c28a02f29f529a353938707d312109e commit 7356681c6c28a02f29f529a353938707d312109e Author: Dimitry Andric AuthorDate: 2021-06-22 16:38:27 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 17:31:32 +0000 Fix failures in libm's lround_test after clang 12 import It turned out that the (type)DTYPE_MAX conversions at the top of s_lround.c are now emitted as cvtsi2sd instructions, at least on SSE capable CPUs. This caused the FE_INEXACT flag to always be set, at least for the double and float variants. Under clang 11, the whole INRANGE() comparisons were still optimized away, but this has "improved" in clang 12, due to stricter adherence to the -ffp-exception-behavior=maytrap compiler flag. To avoid run-time integer to float conversions, use static constants instead, so they are computed at compile time, and the INRANGE() statements are optimized away again, if applicable. While here, use an integer instead of a floating type to store the test results in lround_test.c, as this is more appropriate, and we can also drop the volatile hack. Reported by: arichardson (cherry picked from commit df3b437c1e073eb83e9a93af1c417f3ee8d0de3b) --- lib/msun/src/s_lround.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/msun/src/s_lround.c b/lib/msun/src/s_lround.c index 66d9183a74bc..c4d305401ac8 100644 --- a/lib/msun/src/s_lround.c +++ b/lib/msun/src/s_lround.c @@ -49,9 +49,11 @@ __FBSDID("$FreeBSD$"); * that everything is in range. At compile time, INRANGE(x) should reduce to * two floating-point comparisons in the former case, or TRUE otherwise. */ -static const type dtype_min = (type)DTYPE_MIN - 0.5; -static const type dtype_max = (type)DTYPE_MAX + 0.5; -#define INRANGE(x) (dtype_max - (type)DTYPE_MAX != 0.5 || \ +static const type type_min = (type)DTYPE_MIN; +static const type type_max = (type)DTYPE_MAX; +static const type dtype_min = type_min - 0.5; +static const type dtype_max = type_max + 0.5; +#define INRANGE(x) (dtype_max - type_max != 0.5 || \ ((x) > dtype_min && (x) < dtype_max)) dtype From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 17:33:37 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 5502E667CA8; Fri, 25 Jun 2021 17:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBPHP20mKz4rYG; Fri, 25 Jun 2021 17:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CD3B72FD; Fri, 25 Jun 2021 17:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PHXbhZ099456; Fri, 25 Jun 2021 17:33:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PHXb22099455; Fri, 25 Jun 2021 17:33:37 GMT (envelope-from git) Date: Fri, 25 Jun 2021 17:33:37 GMT Message-Id: <202106251733.15PHXb22099455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 591bd6a9b85d - stable/11 - Fix clang assertion while building recent www/chromium MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 591bd6a9b85d233bbef5eeaae46454f5994bf42f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 17:33:37 -0000 The branch stable/11 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=591bd6a9b85d233bbef5eeaae46454f5994bf42f commit 591bd6a9b85d233bbef5eeaae46454f5994bf42f Author: Dimitry Andric AuthorDate: 2021-06-21 18:46:34 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 17:31:48 +0000 Fix clang assertion while building recent www/chromium Merge commit c8227f06b335 from llvm git (by Arthur Eubanks): [clang] Don't assert in EmitAggregateCopy on trivial_abi types Fixes PR42961. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D97872 PR: 256721, 255570 Reported by: jbeich (cherry picked from commit e7e517981a6591c79fb49cd8810361b0f3ad5983) --- contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp index 8de609a2ccd9..53dbfecfc538 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp @@ -1914,7 +1914,7 @@ void CodeGenFunction::EmitAggregateCopy(LValue Dest, LValue Src, QualType Ty, Record->hasTrivialCopyAssignment() || Record->hasTrivialMoveConstructor() || Record->hasTrivialMoveAssignment() || - Record->isUnion()) && + Record->hasAttr() || Record->isUnion()) && "Trying to aggregate-copy a type without a trivial copy/move " "constructor or assignment operator"); // Ignore empty classes in C++. From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 17:33:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 92A2B667CAA; Fri, 25 Jun 2021 17:33:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBPHQ3Sqtz4rYH; Fri, 25 Jun 2021 17:33:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C43F776C; Fri, 25 Jun 2021 17:33:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PHXcSF099484; Fri, 25 Jun 2021 17:33:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PHXc0u099483; Fri, 25 Jun 2021 17:33:38 GMT (envelope-from git) Date: Fri, 25 Jun 2021 17:33:38 GMT Message-Id: <202106251733.15PHXc0u099483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: a35615900cf5 - stable/11 - Disable llvm generating 128-bit multiply libcalls on 32-bit ARM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: a35615900cf525d1b4318837ccd4ce32fdf0fe5c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 17:33:38 -0000 The branch stable/11 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a35615900cf525d1b4318837ccd4ce32fdf0fe5c commit a35615900cf525d1b4318837ccd4ce32fdf0fe5c Author: Dimitry Andric AuthorDate: 2021-06-22 20:26:13 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 17:31:53 +0000 Disable llvm generating 128-bit multiply libcalls on 32-bit ARM Merge commit 789708617d20 from llvm git (Koutheir Attouchi): Do not generate calls to the 128-bit function __multi3() on 32-bit ARM Re-applying this patch after bots failures. Should be fine now. The function __multi3() is undefined on 32-bit ARM, so a call to it should never be emitted. Instead, plain instructions need to be generated to perform 128-bit multiplications. Differential Revision: https://reviews.llvm.org/D103906 Reported by: mmel (cherry picked from commit 014a40f8f643a5dad6a6ba5c4bf6ea5d4f445fe6) --- contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp index 9f504b1eaa42..00e709292eb8 100644 --- a/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -511,6 +511,7 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM, setLibcallName(RTLIB::SHL_I128, nullptr); setLibcallName(RTLIB::SRL_I128, nullptr); setLibcallName(RTLIB::SRA_I128, nullptr); + setLibcallName(RTLIB::MUL_I128, nullptr); // RTLIB if (Subtarget->isAAPCS_ABI() && From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 18:45:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 F128E640E79; Fri, 25 Jun 2021 18:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBQtt6pfWz4vnQ; Fri, 25 Jun 2021 18:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C5A710991; Fri, 25 Jun 2021 18:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PIjwQH093266; Fri, 25 Jun 2021 18:45:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PIjwji093265; Fri, 25 Jun 2021 18:45:58 GMT (envelope-from git) Date: Fri, 25 Jun 2021 18:45:58 GMT Message-Id: <202106251845.15PIjwji093265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 450f3e55bdad - stable/13 - Work around bogus old gcc "initializer element is not constant" error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 450f3e55bdad40578c58653134408b7bc451b8b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 18:46:00 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=450f3e55bdad40578c58653134408b7bc451b8b9 commit 450f3e55bdad40578c58653134408b7bc451b8b9 Author: Dimitry Andric AuthorDate: 2021-06-25 18:42:38 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 18:45:36 +0000 Work around bogus old gcc "initializer element is not constant" error After df3b437c1e073eb83e9a93af1c417f3ee8d0de3b, older gcc's such as 4.2.1 (still used on earlier branches for e.g. mips and powerpc) and 6.3.0 (still used for some cross-builds) started throwing bogus errors like: In file included from /workspace/src/lib/msun/src/s_llround.c:11:0: /workspace/src/lib/msun/src/s_lround.c:54:31: error: initializer element is not constant static const type dtype_min = type_min - 0.5; ^~~~~~~~ /workspace/src/lib/msun/src/s_lround.c:55:31: error: initializer element is not constant static const type dtype_max = type_max + 0.5; ^~~~~~~~ Since 'type_min' and 'type_max' are constants declared just above these lines this error is nonsensical, but older gcc's are not smart enough. Work around the error by reusing the (type)DTYPE_MIN and (type)DTYPE_MAX macros, so I can MFC this right away, unbreaking a few stable builds. (cherry picked from commit 0bcd49c13ada1461bcea85e0466811ddcb290b5e) --- lib/msun/src/s_lround.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msun/src/s_lround.c b/lib/msun/src/s_lround.c index c4d305401ac8..1dd8e697f703 100644 --- a/lib/msun/src/s_lround.c +++ b/lib/msun/src/s_lround.c @@ -51,8 +51,8 @@ __FBSDID("$FreeBSD$"); */ static const type type_min = (type)DTYPE_MIN; static const type type_max = (type)DTYPE_MAX; -static const type dtype_min = type_min - 0.5; -static const type dtype_max = type_max + 0.5; +static const type dtype_min = (type)DTYPE_MIN - 0.5; +static const type dtype_max = (type)DTYPE_MAX + 0.5; #define INRANGE(x) (dtype_max - type_max != 0.5 || \ ((x) > dtype_min && (x) < dtype_max)) From owner-dev-commits-src-branches@freebsd.org Fri Jun 25 18:46:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 16325641393; Fri, 25 Jun 2021 18:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBQvQ07rmz3Bsm; Fri, 25 Jun 2021 18:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E151710975; Fri, 25 Jun 2021 18:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15PIkPmm093411; Fri, 25 Jun 2021 18:46:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15PIkPv4093410; Fri, 25 Jun 2021 18:46:25 GMT (envelope-from git) Date: Fri, 25 Jun 2021 18:46:25 GMT Message-Id: <202106251846.15PIkPv4093410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 97358891aa6a - stable/12 - Work around bogus old gcc "initializer element is not constant" error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 97358891aa6aa5101bc3b0a673157538a0212e35 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 18:46:26 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=97358891aa6aa5101bc3b0a673157538a0212e35 commit 97358891aa6aa5101bc3b0a673157538a0212e35 Author: Dimitry Andric AuthorDate: 2021-06-25 18:42:38 +0000 Commit: Dimitry Andric CommitDate: 2021-06-25 18:46:02 +0000 Work around bogus old gcc "initializer element is not constant" error After df3b437c1e073eb83e9a93af1c417f3ee8d0de3b, older gcc's such as 4.2.1 (still used on earlier branches for e.g. mips and powerpc) and 6.3.0 (still used for some cross-builds) started throwing bogus errors like: In file included from /workspace/src/lib/msun/src/s_llround.c:11:0: /workspace/src/lib/msun/src/s_lround.c:54:31: error: initializer element is not constant static const type dtype_min = type_min - 0.5; ^~~~~~~~ /workspace/src/lib/msun/src/s_lround.c:55:31: error: initializer element is not constant static const type dtype_max = type_max + 0.5; ^~~~~~~~ Since 'type_min' and 'type_max' are constants declared just above these lines this error is nonsensical, but older gcc's are not smart enough. Work around the error by reusing the (type)DTYPE_MIN and (type)DTYPE_MAX macros, so I can MFC this right away, unbreaking a few stable builds. (cherry picked from commit 0bcd49c13ada1461bcea85e0466811ddcb290b5e) --- lib/msun/src/s_lround.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msun/src/s_lround.c b/lib/msun/src/s_lround.c index c4d305401ac8..1dd8e697f703 100644 --- a/lib/msun/src/s_lround.c +++ b/lib/msun/src/s_lround.c @@ -51,8 +51,8 @@ __FBSDID("$FreeBSD$"); */ static const type type_min = (type)DTYPE_MIN; static const type type_max = (type)DTYPE_MAX; -static const type dtype_min = type_min - 0.5; -static const type dtype_max = type_max + 0.5; +static const type dtype_min = (type)DTYPE_MIN - 0.5; +static const type dtype_max = (type)DTYPE_MAX + 0.5; #define INRANGE(x) (dtype_max - type_max != 0.5 || \ ((x) > dtype_min && (x) < dtype_max)) From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 00:35:34 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 2FA6D64700B; Sat, 26 Jun 2021 00:35:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBZfG0YvCz3pDN; Sat, 26 Jun 2021 00:35:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBD9615412; Sat, 26 Jun 2021 00:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15Q0ZXe0062988; Sat, 26 Jun 2021 00:35:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15Q0ZX2d062987; Sat, 26 Jun 2021 00:35:33 GMT (envelope-from git) Date: Sat, 26 Jun 2021 00:35:33 GMT Message-Id: <202106260035.15Q0ZX2d062987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Nathan Whitehorn Subject: git: 5a4dffac6001 - stable/13 - Fix scripted installation from media without local distfiles. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a4dffac60014e883092ed7f133c8ecd198f2b24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 00:35:34 -0000 The branch stable/13 has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=5a4dffac60014e883092ed7f133c8ecd198f2b24 commit 5a4dffac60014e883092ed7f133c8ecd198f2b24 Author: Nathan Whitehorn AuthorDate: 2021-05-28 13:53:42 +0000 Commit: Nathan Whitehorn CommitDate: 2021-06-26 00:35:04 +0000 Fix scripted installation from media without local distfiles. The bsdinstall script target did not have the infrastructure to fetch distfiles from a remote server the way the interactive installer does on e.g. bootonly media. Solve this by factoring out the parts of the installer that deal with fetching missing distributions into a new install stage called 'fetchmissingdists', which is called by both the interactive and scripted installer frontends. In the course of these changes, cleaned up a few other issues with the fetching of missing distribution files and added a warning if fetching the MANIFEST file, which is used to verify the integrity of the distribution files. We should at some point add cryptographic signatures to MANIFEST so that it can be fetched safely if not present on the install media (which it is for bootonly media). Initial patch by: Vinícius Zavam PR: 255659, 250928 Reviewed by: dteske MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D27121 (cherry picked from commit 40923b0c81cc2c151388ec5ead59f4bed89ac432) --- usr.sbin/bsdinstall/scripts/Makefile | 8 +- usr.sbin/bsdinstall/scripts/auto | 96 ++----------------- usr.sbin/bsdinstall/scripts/bootconfig | 6 +- usr.sbin/bsdinstall/scripts/fetchmissingdists | 132 ++++++++++++++++++++++++++ usr.sbin/bsdinstall/scripts/script | 8 ++ 5 files changed, 154 insertions(+), 96 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/Makefile b/usr.sbin/bsdinstall/scripts/Makefile index 11c4564ea909..147f49609921 100644 --- a/usr.sbin/bsdinstall/scripts/Makefile +++ b/usr.sbin/bsdinstall/scripts/Makefile @@ -1,9 +1,9 @@ # $FreeBSD$ -SCRIPTS= auto adduser bootconfig checksum config docsinstall entropy hardening \ - hostname jail keymap mirrorselect mount netconfig netconfig_ipv4 \ - netconfig_ipv6 rootpass script services time umount wlanconfig \ - zfsboot +SCRIPTS= auto adduser bootconfig checksum config docsinstall entropy \ + fetchmissingdists hardening hostname jail keymap mirrorselect mount \ + netconfig netconfig_ipv4 netconfig_ipv6 rootpass script services time \ + umount wlanconfig zfsboot BINDIR= ${LIBEXECDIR}/bsdinstall MAN= diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index 58e74acb2d92..68809a22671b 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -77,7 +77,6 @@ error() local prompt="${1:+$1\n\n}$msg_an_installation_step_has_been_aborted" local hline="$hline_arrows_tab_space_enter" - [ "$DISTDIR_IS_UNIONFS" ] && umount -f "$BSDINSTALL_DISTDIR" [ -f "$PATH_FSTAB" ] && bsdinstall umount local height width @@ -170,17 +169,12 @@ if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then done fi -LOCAL_DISTRIBUTIONS="MANIFEST" FETCH_DISTRIBUTIONS="" for dist in $DISTRIBUTIONS; do if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist" - else - LOCAL_DISTRIBUTIONS="$LOCAL_DISTRIBUTIONS $dist" fi done -LOCAL_DISTRIBUTIONS=`echo $LOCAL_DISTRIBUTIONS` # Trim white space -FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then dialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 @@ -188,15 +182,6 @@ if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then NETCONFIG_DONE=yes fi -if [ -n "$FETCH_DISTRIBUTIONS" ]; then - exec 3>&1 - BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&3) - MIRROR_BUTTON=$? - exec 3>&- - test $MIRROR_BUTTON -eq 0 || error "No mirror selected" - export BSDINSTALL_DISTSITE -fi - rm -f $PATH_FSTAB touch $PATH_FSTAB @@ -347,79 +332,14 @@ case "$PARTMODE" in ;; esac -if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then - ALL_DISTRIBUTIONS="$DISTRIBUTIONS" - WANT_DEBUG= - - # Download to a directory in the new system as scratch space - BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/freebsd-dist" - mkdir -p "$BSDINSTALL_FETCHDEST" || error "Could not create directory $BSDINSTALL_FETCHDEST" - - export DISTRIBUTIONS="$FETCH_DISTRIBUTIONS" - # Try to use any existing distfiles - if [ -d $BSDINSTALL_DISTDIR ]; then - DISTDIR_IS_UNIONFS=1 - mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR" - else - export DISTRIBUTIONS="$FETCH_DISTRIBUTIONS" - export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST" - fi - - export FTP_PASSIVE_MODE=YES - # Iterate through the distribution list and set a flag if debugging - # distributions have been selected. - for _DISTRIBUTION in $DISTRIBUTIONS; do - case $_DISTRIBUTION in - *-dbg.*) - [ -e $BSDINSTALL_DISTDIR/$_DISTRIBUTION ] \ - && continue - WANT_DEBUG=1 - DEBUG_LIST="\n$DEBUG_LIST\n$_DISTRIBUTION" - ;; - *) - ;; - esac - done - - # Fetch the distributions. - bsdinstall distfetch - rc=$? - - if [ $rc -ne 0 ]; then - # If unable to fetch the remote distributions, recommend - # deselecting the debugging distributions, and retrying the - # installation, since failure to fetch *-dbg.txz should not - # be considered a fatal installation error. - msg="Failed to fetch remote distribution" - if [ ! -z "$WANT_DEBUG" ]; then - # Trim leading and trailing newlines. - DEBUG_LIST="${DEBUG_LIST%%\n}" - DEBUG_LIST="${DEBUG_LIST##\n}" - msg="$msg\n\nPlease deselect the following distributions" - msg="$msg and retry the installation:" - msg="$msg\n$DEBUG_LIST" - fi - error "$msg" - fi - export DISTRIBUTIONS="$ALL_DISTRIBUTIONS" -fi +if [ -n "$FETCH_DISTRIBUTIONS" ]; then + exec 3>&1 + export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&3) + FETCH_RESULT=$? + exec 3>&- -if [ ! -z "$LOCAL_DISTRIBUTIONS" ]; then - # Download to a directory in the new system as scratch space - BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/freebsd-dist" - mkdir -p "$BSDINSTALL_FETCHDEST" || error "Could not create directory $BSDINSTALL_FETCHDEST" - # Try to use any existing distfiles - if [ -d $BSDINSTALL_DISTDIR ]; then - DISTDIR_IS_UNIONFS=1 - mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR" - export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST" - fi - env DISTRIBUTIONS="$LOCAL_DISTRIBUTIONS" \ - BSDINSTALL_DISTSITE="file:///usr/freebsd-dist" \ - bsdinstall distfetch || \ - error "Failed to fetch distribution from local media" + [ $FETCH_RESULT -ne 0 ] && error "Could not fetch remote distributions" fi - bsdinstall checksum || error "Distribution checksum failed" bsdinstall distextract || error "Distribution extract failed" @@ -498,10 +418,6 @@ finalconfig trap error SIGINT # SIGINT is bad again bsdinstall config || error "Failed to save config" -if [ -n "$DISTDIR_IS_UNIONFS" ]; then - umount -f $BSDINSTALL_DISTDIR -fi - if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then rm -rf "$BSDINSTALL_FETCHDEST" fi diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index a592142d87a2..c0a0ff4f77ee 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -83,8 +83,10 @@ if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then bootlabel="FreeBSD" - f_dprintf "Creating UEFI boot entry" - efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null + if [ "$BSDINSTALL_CONFIGCURRENT" ]; then + f_dprintf "Creating UEFI boot entry" + efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null + fi f_dprintf "Finished configuring ESP" fi diff --git a/usr.sbin/bsdinstall/scripts/fetchmissingdists b/usr.sbin/bsdinstall/scripts/fetchmissingdists new file mode 100644 index 000000000000..768217e2fb8c --- /dev/null +++ b/usr.sbin/bsdinstall/scripts/fetchmissingdists @@ -0,0 +1,132 @@ +#!/bin/sh +#- +# Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013-2018 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +error() +{ + dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox $1 0 0 + exit 1 +} + +FETCH_DISTRIBUTIONS="" +LOCAL_DISTRIBUTIONS="" +for dist in $DISTRIBUTIONS; do + if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then + FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist" + else + LOCAL_DISTRIBUTIONS="$LOCAL_DISTRIBUTIONS $dist" + fi +done +LOCAL_DISTRIBUTIONS=`echo $LOCAL_DISTRIBUTIONS` # Trim white space +FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space + +if [ -z "$FETCH_DISTRIBUTIONS" ]; then + echo $BSDINSTALL_DISTDIR >&2 + exit 0 +fi + +ALL_DISTRIBUTIONS="$DISTRIBUTIONS" +WANT_DEBUG= + +# Download to a directory in the new system as scratch space +BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/freebsd-dist" +mkdir -p "$BSDINSTALL_FETCHDEST" || error "Could not create directory $BSDINSTALL_FETCHDEST" + +if [ -z "$BSDINSTALL_DISTSITE" ]; then + exec 3>&1 + BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&3) + MIRROR_BUTTON=$? + exec 3>&- + test $MIRROR_BUTTON -eq 0 || error "No mirror selected" + export BSDINSTALL_DISTSITE +fi + +BSDINSTALL_DISTDIR_ORIG="$BSDINSTALL_DISTDIR" +export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST" +export FTP_PASSIVE_MODE=YES + +if [ -f "$BSDINSTALL_DISTDIR_ORIG/MANIFEST" ]; then + cp "$BSDINSTALL_DISTDIR_ORIG/MANIFEST" "$BSDINSTALL_DISTDIR/MANIFEST" + VERIFY_MANIFEST_SIG=0 +else + FETCH_DISTRIBUTIONS="MANIFEST $FETCH_DISTRIBUTIONS" + VERIFY_MANIFEST_SIG=1 + + # XXX actually verify signature on manifest + dialog --backtitle "FreeBSD Installer" --title "Warning" --msgbox "Manifest not found on local disk and will be fetched from an unverified source. This is a potential security risk. If you do not wish to proceed, press control-C now." 0 0 +fi + +if [ ! -z "$LOCAL_DISTRIBUTIONS" ]; then + # Copy local stuff first + env DISTRIBUTIONS="$LOCAL_DISTRIBUTIONS" \ + BSDINSTALL_DISTSITE="file://$BSDINSTALL_DISTDIR" \ + bsdinstall distfetch || \ + error "Failed to fetch distribution from local media" +fi + +export DISTRIBUTIONS="$FETCH_DISTRIBUTIONS" + +# Iterate through the distribution list and set a flag if debugging +# distributions have been selected. +for _DISTRIBUTION in $DISTRIBUTIONS; do + case $_DISTRIBUTION in + *-dbg.*) + [ -e $BSDINSTALL_DISTDIR/$_DISTRIBUTION ] \ + && continue + WANT_DEBUG=1 + DEBUG_LIST="\n$DEBUG_LIST\n$_DISTRIBUTION" + ;; + *) + ;; + esac +done + +# Fetch the distributions. +bsdinstall distfetch +rc=$? + +if [ $rc -ne 0 ]; then + # If unable to fetch the remote distributions, recommend + # deselecting the debugging distributions, and retrying the + # installation, since failure to fetch *-dbg.txz should not + # be considered a fatal installation error. + msg="Failed to fetch remote distribution" + if [ ! -z "$WANT_DEBUG" ]; then + # Trim leading and trailing newlines. + DEBUG_LIST="${DEBUG_LIST%%\n}" + DEBUG_LIST="${DEBUG_LIST##\n}" + msg="$msg\n\nPlease deselect the following distributions" + msg="$msg and retry the installation:" + msg="$msg\n$DEBUG_LIST" + fi + error "$msg" +fi + +echo $BSDINSTALL_DISTDIR >&2 + diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script index 6a03e88bba39..131ef008d35f 100755 --- a/usr.sbin/bsdinstall/scripts/script +++ b/usr.sbin/bsdinstall/scripts/script @@ -114,6 +114,14 @@ else fi bsdinstall mount +# Fetch missing distribution files, if any +exec 3>&1 +export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&3) +FETCH_RESULT=$? +exec 3>&- + +[ $FETCH_RESULT -ne 0 ] && error "Could not fetch remote distributions" + # Unpack distributions bsdinstall checksum if [ -t 0 ]; then From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 04:11:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 6385864B09A for ; Sat, 26 Jun 2021 04:11:38 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-23.consmr.mail.gq1.yahoo.com (sonic304-23.consmr.mail.gq1.yahoo.com [98.137.68.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBgRZ011Cz4pfP for ; Sat, 26 Jun 2021 04:11:34 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1624680692; bh=y/tF0b6lrnZqssqMXLqDCV+ZAzkUAqyuAZHartPR28B=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=mHvyu0FMXsBp+ygFmY9ixz/YfVLy7kpijItZcBZooAUsZ8ZTHkWLSIu98GhzJQQUy5IlxcCZ6yl6Uk2mPnR0inIdfvzkFxVU/d+ZdX3mtWDqorpWE4KuA0H4L8cy5EjE3KP2kz2pC81p9DUOppSlq2HAYgjb4NVypXQVTRWz3x43NIP2YFuoN+FfV5soqhMaPQE8+zwGsTMC/xt3KV2D6mfhey0HMgPceK2kuGzm+vVR+dquA5fxzHsImAEEW7LmI2Pql25pSkDntIOlPdbqhme1lzRfJ0SArrXOT8uuug4v5Hwq2JpmpeD1c9oTDkgFhAoXUSzfqX6gzIPvLKyQRg== X-YMail-OSG: WQ5m00YVM1kbscWnqnmqqqTdKkG.QJYECYvqBb8ACnE9kgC73fuQO6nsJ6XmnWP X12s.F3SrXDoEUGMRt7hyml0A8g1oXVrLyYRgucFgR64aUYJxR32yHhSMYRmu1eBTp7oOIxMAi9k RP3nksPEzI0PBpZvXOUklT0cb_2yqIR3c7tM3AX._R7J7mU.bijYJUXvfPQXVWxWL6GmM9hitvSY LBNjVS70kIFZSbivJyijU7wkeEbZ3D3DcEYO_s2HPBdj04730wgjZLLW1fl1YjAhnRm8WSvjfiFv 7XohRXEc3GGUhhJX7oqz62GnYqvLwyTWR3d9Z.Jyv9n8tvkdGbxLQXlnqQgutTTas2W2MQW0GJaE 8Mdtf_5c21YpgARZ0wVXSWbdsFf8w2woEnxeusOAmzSeXddejvTsn.iORkjsWbDkHcuoRvMbKRV6 jG.Yt7VK0553E3mFwqE4Hi74lcjmg5NW.ewFhNgJl9yJ_3pBBwhzI69B0pbocRxyFPv1pfvbPI.j EdNUmItiC8oOt1lAlryRq_RVM6quNoXRi7BAWVZ6eCtUQmN4mUcFAZQ6qgXViDL6dSBrSB8ohBFV ey33FCNxFxfOlbbXsc326jY5dx8m2VfKlMbHgpQ1dzjtn3rnf2w6t0.dewCFCXrWPVPCGvJS.rcN RXtutlyQp.ELsLEk4lPMJMHgAlgXF72JtJK70AgXFbNrq.Z.hEsEPRnuixogSQc9lSkCPgUlcdmu 22rMjJlBIEdhu2JvJH2fJSzPS0GXFqbbaodl.bGgmKhdMtERj1jMDqDqBGMuj__ycZk6p3Lf5UCE 9doDxy_Odvzj2c445jReWtZ1rP_3QRpygMRAH690JDuYD3s3RE7a99KWTO26hSwhUKGW6cA7p9n2 1ur8xLrVo1AZKwkuiBAMJCE.iXh0_8fsVAk1KqcXFQYj5JODrb9YEZ63z_VLkUYsP1eOEC5unCCz 4YszjxZW0eI90aNTcwoh4jjxBrTzfuFdqcjuC4oAL.Cgku3CdNGVdHYUk7VmEe57_qPRWja9Zg37 HNG.1g6okD0WE1vZE_E4tbqrUAH_0wHUH481sDXwvFtEV6r4DYxS8QHQbKa80hUuHAACeCi1wcjQ rU4tKhfbCR7gOvsbGKNSPOsbDGi7s.2MbLUU7LyoNGd3zaDuuPB558p1VnKW2KKM18Ns1Cxgyy2w nqQIHYkIC5L7O6T54fV5uAP1QDToEqAB_8RN8uA3H8yJI6p3Zs4FWDq0YdYXGXqudeopdwdaNH3t jiTcuyS9mtiYOnDJ62Wm94INYTX.HOLITzljuNFjwM8olvtzFRVIIawc4ggl5_jWxY9xiJl_lF0g o2l3hS0JQP5imdEZ0IrD8Bl_aQPr5eQe9uZLQi_WRk94Wtz4H4bCEF7W71bvHwHBHYmf80WDUTxB bLdx46lnSy6A5dP9OKk_ie1CtVAV_sw7e1GIINcW8giG0legKiOLUPOMRQ8qGH3yxYZnhFhQI2XM bOHwsTZNukYUOCsKk9jr_yNViUnauIOXIXBAxF1hP8vfZSIzVSth_Gv4GC4Razw9tuiWkm3GN.G_ MjeV2SVh830UC41N6oabCXp49rxNWZ9_gQweAjxR5StE0zzrfYo.V_va1a6g7kIA1O0QSez63n2Y Wf1ls.xddbTJMHqUI2cW6hSbjC48JH6j9FA4wiQdGu6JEenET3Pp15hGpzKw_VM0PYx6IIWEafnh wIlPO7rD1YXP.eVPs3wvXKUK2O6hG5snJfglCyqPN_SpFnhPtxdFzfXhQlZrFjgeRMo47RcAH7Qk xjE3DSiqInvMNKYu9Gqw4PleAUIqK71Am6WcYblPd_.AHCOWTtXF0eldZ4LgnM22SUTKCsnNuLUw 48gBW1F7l2qFoHiZomtzcALYvfHslYv6DmhqXehMA7D.jQoYgyhV4XPPV.UQItqjsOObWnqnGqSk izWTvuUZ7A2CCeLgYZ_VT_jN6NrIuPlRffS2eR9IbQzZvgDlj4gULECJ9AfL1euTsZEGsqXzOkVg zrhvA3wJyBogexM.NoG23PPdFnBUGY2_CHTucqgDS.9wMjO2cIP1BzAKOPe75Z3yG7lSCL0SuOd1 o1fLnjizldjhTfuDXpfg18eP4aLe8Hw4vZBL2gX_4tIK1PssAwku0cieub5q54m_lZgZO4Opv6MO psEuklViMOCo__vQDnK8J46fCwOIC2Q.i.o0YaPA8TMrTYymwgrAaH0zCFvfsAS4p6yFCt2f.wh8 fv9toWZRrOanb5qE4IbBt7cYNtlyCYBG1rYmmLzeWizY55AjQyGGR44vW.fK7kBlaP1ieZsubnRN RX8afuyUjP5WBsRbAbS3oIgZFxP_ZwegVco._rofBGrGCjRE0yNxqp_aaIUmJx3wspqumeulgscg MSQu39Wj6OmpjzfK6F_LGvytLoWHmC.fDA6LszpsF.USyyjZTJ7IU32JQrX1AnyqIoG252.OtqS6 a6xy9Vg1go.uoaSH3mBadUl_R6wdtDnmWjdRcZmG_QsONGWULzpq7LIKbnpGwD2u0v8XGAmy13ey 5GojzDnc3uAix9Yni76EVcrxYoTHxFtnsJljEK4npqwsnkksrklayC4jU4TMVpN.oJSLohQ-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Sat, 26 Jun 2021 04:11:32 +0000 Received: by kubenode547.mail-prod1.omega.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 20ebf68e809298a086c6bcc93d40d047; Sat, 26 Jun 2021 04:11:28 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: 450f3e55bdad - stable/13 - Work around bogus old gcc "initializer element is not constant" error Message-Id: <87104032-C5B9-447D-9545-B30AF983ACB7@yahoo.com> Date: Fri, 25 Jun 2021 21:11:27 -0700 To: Dimitry Andric , dev-commits-src-branches@freebsd.org X-Mailer: Apple Mail (2.3654.100.0.2.22) References: <87104032-C5B9-447D-9545-B30AF983ACB7.ref@yahoo.com> X-Rspamd-Queue-Id: 4GBgRZ011Cz4pfP X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.68.204:from]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.68.204:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.204:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.204:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-branches] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 04:11:38 -0000 Dimitry Andric dim at FreeBSD.org wrote on Fri Jun 25 18:46:00 UTC 2021 : . . . > In file included from /workspace/src/lib/msun/src/s_llround.c:11:0: > /workspace/src/lib/msun/src/s_lround.c:54:31: error: initializer = element is not constant > static const type dtype_min =3D type_min - 0.5; > ^~~~~~~~ > /workspace/src/lib/msun/src/s_lround.c:55:31: error: initializer = element is not constant > static const type dtype_max =3D type_max + 0.5; > ^~~~~~~~ > =20 > Since 'type_min' and 'type_max' are constants declared just above = these > lines this error is nonsensical, but older gcc's are not smart = enough. . . . Well, in C "const" historically means closer to "read-only" than to is-a-constant-expression in the language, unfortunately. Part of this is the conversion away from being an lvalue (so: where an lvalue is not required) loses the const qualification as part of the conversion. As: https://en.cppreference.com/w/cpp/language/constexpr words it in the notes: QUOTE C adopted the const qualifier from C++, but unlike in C++, expressions of const-qualified type in C are not constant expressions; they may not be used as case labels or to initialize static and thread storage duration objects, enumerators, or bit field sizes. When they are used as array sizes, the resulting arrays are VLAs. END QUOTE =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 08:58:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 D860F64F733; Sat, 26 Jun 2021 08:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBnps5psQz3sN0; Sat, 26 Jun 2021 08:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF4981C287; Sat, 26 Jun 2021 08:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15Q8wj06028631; Sat, 26 Jun 2021 08:58:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15Q8wjRM028630; Sat, 26 Jun 2021 08:58:45 GMT (envelope-from git) Date: Sat, 26 Jun 2021 08:58:45 GMT Message-Id: <202106260858.15Q8wjRM028630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: b4c7aa06c561 - stable/13 - pf: Mark struct pf_pdesc as kernel only MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b4c7aa06c561adb798c7f99b46273f0aeeea129c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 08:58:45 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4c7aa06c561adb798c7f99b46273f0aeeea129c commit b4c7aa06c561adb798c7f99b46273f0aeeea129c Author: Kristof Provost AuthorDate: 2021-03-03 09:28:14 +0000 Commit: Kristof Provost CommitDate: 2021-06-26 08:57:37 +0000 pf: Mark struct pf_pdesc as kernel only This structure is only used by the kernel module internally. It's not shared with user space, so hide it behind #ifdef _KERNEL. Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 29698ed904737ebfd139a21e39e5421cf81badd8) --- sys/net/pfvar.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 00db46521148..2202421086d2 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -896,6 +896,7 @@ struct pfi_kkif { #define PFI_IFLAG_REFS 0x0001 /* has state references */ #define PFI_IFLAG_SKIP 0x0100 /* skip filtering on interface */ +#ifdef _KERNEL struct pf_pdesc { struct { int done; @@ -935,6 +936,7 @@ struct pf_pdesc { u_int8_t sidx; /* key index for source */ u_int8_t didx; /* key index for destination */ }; +#endif /* flags for RDR options */ #define PF_DPORT_RANGE 0x01 /* Dest port uses range */ From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 08:58:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 D999164F48A; Sat, 26 Jun 2021 08:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBnpt5pnRz3sFy; Sat, 26 Jun 2021 08:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF4891C288; Sat, 26 Jun 2021 08:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15Q8wkau028717; Sat, 26 Jun 2021 08:58:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15Q8wkqK028716; Sat, 26 Jun 2021 08:58:46 GMT (envelope-from git) Date: Sat, 26 Jun 2021 08:58:46 GMT Message-Id: <202106260858.15Q8wkqK028716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 27d14a1e5cb2 - stable/12 - pf: Mark struct pf_pdesc as kernel only MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 27d14a1e5cb228d8fbb25013e1750913c524045a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 08:58:47 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27d14a1e5cb228d8fbb25013e1750913c524045a commit 27d14a1e5cb228d8fbb25013e1750913c524045a Author: Kristof Provost AuthorDate: 2021-03-03 09:28:14 +0000 Commit: Kristof Provost CommitDate: 2021-06-26 08:55:21 +0000 pf: Mark struct pf_pdesc as kernel only This structure is only used by the kernel module internally. It's not shared with user space, so hide it behind #ifdef _KERNEL. Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 29698ed904737ebfd139a21e39e5421cf81badd8) --- sys/net/pfvar.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index c7890b99e05a..eb63af9d47d3 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -896,6 +896,7 @@ struct pfi_kkif { #define PFI_IFLAG_REFS 0x0001 /* has state references */ #define PFI_IFLAG_SKIP 0x0100 /* skip filtering on interface */ +#ifdef _KERNEL struct pf_pdesc { struct { int done; @@ -935,6 +936,7 @@ struct pf_pdesc { u_int8_t sidx; /* key index for source */ u_int8_t didx; /* key index for destination */ }; +#endif /* flags for RDR options */ #define PF_DPORT_RANGE 0x01 /* Dest port uses range */ From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 08:58:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 296B064F826; Sat, 26 Jun 2021 08:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBnpt6wBFz3sY3; Sat, 26 Jun 2021 08:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1B101BF77; Sat, 26 Jun 2021 08:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15Q8wkLJ028741; Sat, 26 Jun 2021 08:58:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15Q8wk6t028740; Sat, 26 Jun 2021 08:58:46 GMT (envelope-from git) Date: Sat, 26 Jun 2021 08:58:46 GMT Message-Id: <202106260858.15Q8wk6t028740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c816b23784a6 - stable/13 - pf: store L4 headers in pf_pdesc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c816b23784a61b5a3222f3db1ce595c06f2c4005 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 08:58:47 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c816b23784a61b5a3222f3db1ce595c06f2c4005 commit c816b23784a61b5a3222f3db1ce595c06f2c4005 Author: Kristof Provost AuthorDate: 2021-06-04 08:52:07 +0000 Commit: Kristof Provost CommitDate: 2021-06-26 08:57:37 +0000 pf: store L4 headers in pf_pdesc Rather than pointers to the headers store full copies. This brings us slightly closer to what OpenBSD does, and also makes more sense than storing pointers to stack variable copies of the headers. Reviewed by: donner, scottl MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30719 (cherry picked from commit d38630f6192a40934912fbffc52c9650776c2b53) --- sys/net/pfvar.h | 19 +++-- sys/netpfil/pf/pf.c | 182 +++++++++++++++++++++-------------------------- sys/netpfil/pf/pf_lb.c | 2 +- sys/netpfil/pf/pf_norm.c | 2 +- 4 files changed, 95 insertions(+), 110 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 2202421086d2..0d23607a168a 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -50,6 +50,13 @@ #include #include +#ifdef _KERNEL +#include +#include +#include +#include +#include +#endif #include #include @@ -904,14 +911,14 @@ struct pf_pdesc { gid_t gid; } lookup; u_int64_t tot_len; /* Make Mickey money */ - union { - struct tcphdr *tcp; - struct udphdr *udp; - struct icmp *icmp; + union pf_headers { + struct tcphdr tcp; + struct udphdr udp; + struct icmp icmp; #ifdef INET6 - struct icmp6_hdr *icmp6; + struct icmp6_hdr icmp6; #endif /* INET6 */ - void *any; + char any[0]; } hdr; struct pf_krule *nat_rule; /* nat/rdr rule applied to packet */ diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index bcc9780cfa9d..1b8181b7e1cf 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3113,17 +3113,13 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd, struct mbuf *m) switch (pd->proto) { case IPPROTO_TCP: - if (pd->hdr.tcp == NULL) - return (-1); - sport = pd->hdr.tcp->th_sport; - dport = pd->hdr.tcp->th_dport; + sport = pd->hdr.tcp.th_sport; + dport = pd->hdr.tcp.th_dport; pi = &V_tcbinfo; break; case IPPROTO_UDP: - if (pd->hdr.udp == NULL) - return (-1); - sport = pd->hdr.udp->uh_sport; - dport = pd->hdr.udp->uh_dport; + sport = pd->hdr.udp.uh_sport; + dport = pd->hdr.udp.uh_dport; pi = &V_udbinfo; break; default: @@ -3313,8 +3309,8 @@ pf_tcp_iss(struct pf_pdesc *pd) ctx = V_pf_tcp_secret_ctx; - MD5Update(&ctx, (char *)&pd->hdr.tcp->th_sport, sizeof(u_short)); - MD5Update(&ctx, (char *)&pd->hdr.tcp->th_dport, sizeof(u_short)); + MD5Update(&ctx, (char *)&pd->hdr.tcp.th_sport, sizeof(u_short)); + MD5Update(&ctx, (char *)&pd->hdr.tcp.th_dport, sizeof(u_short)); if (pd->af == AF_INET6) { MD5Update(&ctx, (char *)&pd->src->v6, sizeof(struct in6_addr)); MD5Update(&ctx, (char *)&pd->dst->v6, sizeof(struct in6_addr)); @@ -3342,7 +3338,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, struct pf_krule *r, *a = NULL; struct pf_kruleset *ruleset = NULL; struct pf_ksrc_node *nsn = NULL; - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; struct pf_state_key *sk = NULL, *nk = NULL; u_short reason; int rewrite = 0, hdrlen = 0; @@ -3371,18 +3367,18 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, hdrlen = sizeof(*th); break; case IPPROTO_UDP: - sport = pd->hdr.udp->uh_sport; - dport = pd->hdr.udp->uh_dport; - hdrlen = sizeof(*pd->hdr.udp); + sport = pd->hdr.udp.uh_sport; + dport = pd->hdr.udp.uh_dport; + hdrlen = sizeof(pd->hdr.udp); break; #ifdef INET case IPPROTO_ICMP: if (pd->af != AF_INET) break; - sport = dport = pd->hdr.icmp->icmp_id; - hdrlen = sizeof(*pd->hdr.icmp); - icmptype = pd->hdr.icmp->icmp_type; - icmpcode = pd->hdr.icmp->icmp_code; + sport = dport = pd->hdr.icmp.icmp_id; + hdrlen = sizeof(pd->hdr.icmp); + icmptype = pd->hdr.icmp.icmp_type; + icmpcode = pd->hdr.icmp.icmp_code; if (icmptype == ICMP_UNREACH || icmptype == ICMP_SOURCEQUENCH || @@ -3396,10 +3392,10 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, case IPPROTO_ICMPV6: if (af != AF_INET6) break; - sport = dport = pd->hdr.icmp6->icmp6_id; - hdrlen = sizeof(*pd->hdr.icmp6); - icmptype = pd->hdr.icmp6->icmp6_type; - icmpcode = pd->hdr.icmp6->icmp6_code; + sport = dport = pd->hdr.icmp6.icmp6_id; + hdrlen = sizeof(pd->hdr.icmp6); + icmptype = pd->hdr.icmp6.icmp6_type; + icmpcode = pd->hdr.icmp6.icmp6_code; if (icmptype == ICMP6_DST_UNREACH || icmptype == ICMP6_PACKET_TOO_BIG || @@ -3449,27 +3445,27 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, rewrite++; break; case IPPROTO_UDP: - bproto_sum = pd->hdr.udp->uh_sum; - pd->proto_sum = &pd->hdr.udp->uh_sum; + bproto_sum = pd->hdr.udp.uh_sum; + pd->proto_sum = &pd->hdr.udp.uh_sum; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], af) || nk->port[pd->sidx] != sport) { - pf_change_ap(m, saddr, &pd->hdr.udp->uh_sport, - pd->ip_sum, &pd->hdr.udp->uh_sum, + pf_change_ap(m, saddr, &pd->hdr.udp.uh_sport, + pd->ip_sum, &pd->hdr.udp.uh_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 1, af); - sport = pd->hdr.udp->uh_sport; - pd->sport = &pd->hdr.udp->uh_sport; + sport = pd->hdr.udp.uh_sport; + pd->sport = &pd->hdr.udp.uh_sport; } if (PF_ANEQ(daddr, &nk->addr[pd->didx], af) || nk->port[pd->didx] != dport) { - pf_change_ap(m, daddr, &pd->hdr.udp->uh_dport, - pd->ip_sum, &pd->hdr.udp->uh_sum, + pf_change_ap(m, daddr, &pd->hdr.udp.uh_dport, + pd->ip_sum, &pd->hdr.udp.uh_sum, &nk->addr[pd->didx], nk->port[pd->didx], 1, af); - dport = pd->hdr.udp->uh_dport; - pd->dport = &pd->hdr.udp->uh_dport; + dport = pd->hdr.udp.uh_dport; + pd->dport = &pd->hdr.udp.uh_dport; } rewrite++; break; @@ -3484,25 +3480,25 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, pf_change_a(&daddr->v4.s_addr, pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (nk->port[1] != pd->hdr.icmp->icmp_id) { - pd->hdr.icmp->icmp_cksum = pf_cksum_fixup( - pd->hdr.icmp->icmp_cksum, sport, + if (nk->port[1] != pd->hdr.icmp.icmp_id) { + pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( + pd->hdr.icmp.icmp_cksum, sport, nk->port[1], 0); - pd->hdr.icmp->icmp_id = nk->port[1]; - pd->sport = &pd->hdr.icmp->icmp_id; + pd->hdr.icmp.icmp_id = nk->port[1]; + pd->sport = &pd->hdr.icmp.icmp_id; } - m_copyback(m, off, ICMP_MINLEN, (caddr_t)pd->hdr.icmp); + m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); break; #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: nk->port[0] = nk->port[1]; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], AF_INET6)) - pf_change_a6(saddr, &pd->hdr.icmp6->icmp6_cksum, + pf_change_a6(saddr, &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->sidx], 0); if (PF_ANEQ(daddr, &nk->addr[pd->didx], AF_INET6)) - pf_change_a6(daddr, &pd->hdr.icmp6->icmp6_cksum, + pf_change_a6(daddr, &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->didx], 0); rewrite++; break; @@ -3713,7 +3709,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, { struct pf_state *s = NULL; struct pf_ksrc_node *sn = NULL; - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; u_int16_t mss = V_tcp_mssdflt; u_short reason; @@ -4066,7 +4062,7 @@ pf_tcp_track_full(struct pf_state_peer *src, struct pf_state_peer *dst, struct pf_state **state, struct pfi_kkif *kif, struct mbuf *m, int off, struct pf_pdesc *pd, u_short *reason, int *copyback) { - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; u_int16_t win = ntohs(th->th_win); u_int32_t ack, end, seq, orig_seq; u_int8_t sws, dws; @@ -4392,7 +4388,7 @@ static int pf_tcp_track_sloppy(struct pf_state_peer *src, struct pf_state_peer *dst, struct pf_state **state, struct pf_pdesc *pd, u_short *reason) { - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; if (th->th_flags & TH_SYN) if (src->state < TCPS_SYN_SENT) @@ -4465,7 +4461,7 @@ pf_test_state_tcp(struct pf_state **state, int direction, struct pfi_kkif *kif, u_short *reason) { struct pf_state_key_cmp key; - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; int copyback = 0; struct pf_state_peer *src, *dst; struct pf_state_key *sk; @@ -4633,7 +4629,7 @@ pf_test_state_udp(struct pf_state **state, int direction, struct pfi_kkif *kif, { struct pf_state_peer *src, *dst; struct pf_state_key_cmp key; - struct udphdr *uh = pd->hdr.udp; + struct udphdr *uh = &pd->hdr.udp; bzero(&key, sizeof(key)); key.af = pd->af; @@ -4708,10 +4704,10 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, switch (pd->proto) { #ifdef INET case IPPROTO_ICMP: - icmptype = pd->hdr.icmp->icmp_type; - icmpcode = pd->hdr.icmp->icmp_code; - icmpid = pd->hdr.icmp->icmp_id; - icmpsum = &pd->hdr.icmp->icmp_cksum; + icmptype = pd->hdr.icmp.icmp_type; + icmpcode = pd->hdr.icmp.icmp_code; + icmpid = pd->hdr.icmp.icmp_id; + icmpsum = &pd->hdr.icmp.icmp_cksum; if (icmptype == ICMP_UNREACH || icmptype == ICMP_SOURCEQUENCH || @@ -4723,10 +4719,10 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: - icmptype = pd->hdr.icmp6->icmp6_type; - icmpcode = pd->hdr.icmp6->icmp6_code; - icmpid = pd->hdr.icmp6->icmp6_id; - icmpsum = &pd->hdr.icmp6->icmp6_cksum; + icmptype = pd->hdr.icmp6.icmp6_type; + icmpcode = pd->hdr.icmp6.icmp6_code; + icmpid = pd->hdr.icmp6.icmp6_id; + icmpsum = &pd->hdr.icmp6.icmp6_cksum; if (icmptype == ICMP6_DST_UNREACH || icmptype == ICMP6_PACKET_TOO_BIG || @@ -4778,17 +4774,17 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, nk->addr[pd->didx].v4.s_addr, 0); if (nk->port[0] != - pd->hdr.icmp->icmp_id) { - pd->hdr.icmp->icmp_cksum = + pd->hdr.icmp.icmp_id) { + pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( - pd->hdr.icmp->icmp_cksum, icmpid, + pd->hdr.icmp.icmp_cksum, icmpid, nk->port[pd->sidx], 0); - pd->hdr.icmp->icmp_id = + pd->hdr.icmp.icmp_id = nk->port[pd->sidx]; } m_copyback(m, off, ICMP_MINLEN, - (caddr_t )pd->hdr.icmp); + (caddr_t )&pd->hdr.icmp); break; #endif /* INET */ #ifdef INET6 @@ -4796,17 +4792,17 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], AF_INET6)) pf_change_a6(saddr, - &pd->hdr.icmp6->icmp6_cksum, + &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->sidx], 0); if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], AF_INET6)) pf_change_a6(daddr, - &pd->hdr.icmp6->icmp6_cksum, + &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->didx], 0); m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t )pd->hdr.icmp6); + (caddr_t )&pd->hdr.icmp6); break; #endif /* INET6 */ } @@ -5049,7 +5045,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, #ifdef INET case AF_INET: m_copyback(m, off, ICMP_MINLEN, - (caddr_t )pd->hdr.icmp); + (caddr_t )&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t )&h2); break; @@ -5058,7 +5054,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, case AF_INET6: m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t )pd->hdr.icmp6); + (caddr_t )&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t )&h2_6); break; @@ -5118,7 +5114,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, #ifdef INET case AF_INET: m_copyback(m, off, ICMP_MINLEN, - (caddr_t )pd->hdr.icmp); + (caddr_t )&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); break; #endif /* INET */ @@ -5126,7 +5122,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, case AF_INET6: m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t )pd->hdr.icmp6); + (caddr_t )&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t )&h2_6); break; @@ -5181,7 +5177,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); - m_copyback(m, off, ICMP_MINLEN, (caddr_t)pd->hdr.icmp); + m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); m_copyback(m, off2, ICMP_MINLEN, (caddr_t)&iih); } @@ -5234,7 +5230,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, pd->ip_sum, 0, AF_INET6); m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); + (caddr_t)&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t)&h2_6); m_copyback(m, off2, sizeof(struct icmp6_hdr), (caddr_t)&iih); @@ -5276,7 +5272,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, #ifdef INET case AF_INET: m_copyback(m, off, ICMP_MINLEN, - (caddr_t)pd->hdr.icmp); + (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); break; #endif /* INET */ @@ -5284,7 +5280,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, case AF_INET6: m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t )pd->hdr.icmp6); + (caddr_t )&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t )&h2_6); break; @@ -6033,16 +6029,13 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * switch (h->ip_p) { case IPPROTO_TCP: { - struct tcphdr th; - - pd.hdr.tcp = &th; - if (!pf_pull_hdr(m, off, &th, sizeof(th), + if (!pf_pull_hdr(m, off, &pd.hdr.tcp, sizeof(pd.hdr.tcp), &action, &reason, AF_INET)) { log = action != PF_PASS; goto done; } - pd.p_len = pd.tot_len - off - (th.th_off << 2); - if ((th.th_flags & TH_ACK) && pd.p_len == 0) + pd.p_len = pd.tot_len - off - (pd.hdr.tcp.th_off << 2); + if ((pd.hdr.tcp.th_flags & TH_ACK) && pd.p_len == 0) pqid = 1; action = pf_normalize_tcp(dir, kif, m, 0, off, h, &pd); if (action == PF_DROP) @@ -6062,17 +6055,14 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * } case IPPROTO_UDP: { - struct udphdr uh; - - pd.hdr.udp = &uh; - if (!pf_pull_hdr(m, off, &uh, sizeof(uh), + if (!pf_pull_hdr(m, off, &pd.hdr.udp, sizeof(pd.hdr.udp), &action, &reason, AF_INET)) { log = action != PF_PASS; goto done; } - if (uh.uh_dport == 0 || - ntohs(uh.uh_ulen) > m->m_pkthdr.len - off || - ntohs(uh.uh_ulen) < sizeof(struct udphdr)) { + if (pd.hdr.udp.uh_dport == 0 || + ntohs(pd.hdr.udp.uh_ulen) > m->m_pkthdr.len - off || + ntohs(pd.hdr.udp.uh_ulen) < sizeof(struct udphdr)) { action = PF_DROP; REASON_SET(&reason, PFRES_SHORT); goto done; @@ -6091,10 +6081,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * } case IPPROTO_ICMP: { - struct icmp ih; - - pd.hdr.icmp = &ih; - if (!pf_pull_hdr(m, off, &ih, ICMP_MINLEN, + if (!pf_pull_hdr(m, off, &pd.hdr.icmp, ICMP_MINLEN, &action, &reason, AF_INET)) { log = action != PF_PASS; goto done; @@ -6479,15 +6466,12 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb switch (pd.proto) { case IPPROTO_TCP: { - struct tcphdr th; - - pd.hdr.tcp = &th; - if (!pf_pull_hdr(m, off, &th, sizeof(th), + if (!pf_pull_hdr(m, off, &pd.hdr.tcp, sizeof(pd.hdr.tcp), &action, &reason, AF_INET6)) { log = action != PF_PASS; goto done; } - pd.p_len = pd.tot_len - off - (th.th_off << 2); + pd.p_len = pd.tot_len - off - (pd.hdr.tcp.th_off << 2); action = pf_normalize_tcp(dir, kif, m, 0, off, h, &pd); if (action == PF_DROP) goto done; @@ -6506,17 +6490,14 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb } case IPPROTO_UDP: { - struct udphdr uh; - - pd.hdr.udp = &uh; - if (!pf_pull_hdr(m, off, &uh, sizeof(uh), + if (!pf_pull_hdr(m, off, &pd.hdr.udp, sizeof(pd.hdr.udp), &action, &reason, AF_INET6)) { log = action != PF_PASS; goto done; } - if (uh.uh_dport == 0 || - ntohs(uh.uh_ulen) > m->m_pkthdr.len - off || - ntohs(uh.uh_ulen) < sizeof(struct udphdr)) { + if (pd.hdr.udp.uh_dport == 0 || + ntohs(pd.hdr.udp.uh_ulen) > m->m_pkthdr.len - off || + ntohs(pd.hdr.udp.uh_ulen) < sizeof(struct udphdr)) { action = PF_DROP; REASON_SET(&reason, PFRES_SHORT); goto done; @@ -6542,10 +6523,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb } case IPPROTO_ICMPV6: { - struct icmp6_hdr ih; - - pd.hdr.icmp6 = &ih; - if (!pf_pull_hdr(m, off, &ih, sizeof(ih), + if (!pf_pull_hdr(m, off, &pd.hdr.icmp6, sizeof(pd.hdr.icmp6), &action, &reason, AF_INET6)) { log = action != PF_PASS; goto done; diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 3796ab9fb80a..5e281eccc144 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -182,7 +182,7 @@ pf_match_translation(struct pf_pdesc *pd, struct mbuf *m, int off, r = TAILQ_NEXT(r, entries); else if (r->os_fingerprint != PF_OSFP_ANY && (pd->proto != IPPROTO_TCP || !pf_osfp_match(pf_osfp_fingerprint(pd, m, - off, pd->hdr.tcp), r->os_fingerprint))) + off, &pd->hdr.tcp), r->os_fingerprint))) r = TAILQ_NEXT(r, entries); else { if (r->tag) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 6de1efa8ff84..241bdcb5a073 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1326,7 +1326,7 @@ pf_normalize_tcp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, int off, void *h, struct pf_pdesc *pd) { struct pf_krule *r, *rm = NULL; - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; int rewrite = 0; u_short reason; u_int8_t flags; From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 08:58:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 D2FF464F897; Sat, 26 Jun 2021 08:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBnpv6wJ3z3sN6; Sat, 26 Jun 2021 08:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE9891BF78; Sat, 26 Jun 2021 08:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15Q8wlI6028765; Sat, 26 Jun 2021 08:58:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15Q8wlUj028764; Sat, 26 Jun 2021 08:58:47 GMT (envelope-from git) Date: Sat, 26 Jun 2021 08:58:47 GMT Message-Id: <202106260858.15Q8wlUj028764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 47535a9065ac - stable/12 - pf: store L4 headers in pf_pdesc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 47535a9065aceab49c8d0cdf50673b90c8da1df1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 08:58:49 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=47535a9065aceab49c8d0cdf50673b90c8da1df1 commit 47535a9065aceab49c8d0cdf50673b90c8da1df1 Author: Kristof Provost AuthorDate: 2021-06-04 08:52:07 +0000 Commit: Kristof Provost CommitDate: 2021-06-26 08:55:21 +0000 pf: store L4 headers in pf_pdesc Rather than pointers to the headers store full copies. This brings us slightly closer to what OpenBSD does, and also makes more sense than storing pointers to stack variable copies of the headers. Reviewed by: donner, scottl MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30719 (cherry picked from commit d38630f6192a40934912fbffc52c9650776c2b53) --- sys/net/pfvar.h | 19 +++-- sys/netpfil/pf/pf.c | 182 +++++++++++++++++++++-------------------------- sys/netpfil/pf/pf_lb.c | 2 +- sys/netpfil/pf/pf_norm.c | 2 +- 4 files changed, 95 insertions(+), 110 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index eb63af9d47d3..7e16e40ccc45 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -50,6 +50,13 @@ #include #include +#ifdef _KERNEL +#include +#include +#include +#include +#include +#endif #include #include @@ -904,14 +911,14 @@ struct pf_pdesc { gid_t gid; } lookup; u_int64_t tot_len; /* Make Mickey money */ - union { - struct tcphdr *tcp; - struct udphdr *udp; - struct icmp *icmp; + union pf_headers { + struct tcphdr tcp; + struct udphdr udp; + struct icmp icmp; #ifdef INET6 - struct icmp6_hdr *icmp6; + struct icmp6_hdr icmp6; #endif /* INET6 */ - void *any; + char any[0]; } hdr; struct pf_krule *nat_rule; /* nat/rdr rule applied to packet */ diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9eb8c2f54c42..57bbd355e2fb 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3115,17 +3115,13 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd, struct mbuf *m) switch (pd->proto) { case IPPROTO_TCP: - if (pd->hdr.tcp == NULL) - return (-1); - sport = pd->hdr.tcp->th_sport; - dport = pd->hdr.tcp->th_dport; + sport = pd->hdr.tcp.th_sport; + dport = pd->hdr.tcp.th_dport; pi = &V_tcbinfo; break; case IPPROTO_UDP: - if (pd->hdr.udp == NULL) - return (-1); - sport = pd->hdr.udp->uh_sport; - dport = pd->hdr.udp->uh_dport; + sport = pd->hdr.udp.uh_sport; + dport = pd->hdr.udp.uh_dport; pi = &V_udbinfo; break; default: @@ -3314,8 +3310,8 @@ pf_tcp_iss(struct pf_pdesc *pd) ctx = V_pf_tcp_secret_ctx; - MD5Update(&ctx, (char *)&pd->hdr.tcp->th_sport, sizeof(u_short)); - MD5Update(&ctx, (char *)&pd->hdr.tcp->th_dport, sizeof(u_short)); + MD5Update(&ctx, (char *)&pd->hdr.tcp.th_sport, sizeof(u_short)); + MD5Update(&ctx, (char *)&pd->hdr.tcp.th_dport, sizeof(u_short)); if (pd->af == AF_INET6) { MD5Update(&ctx, (char *)&pd->src->v6, sizeof(struct in6_addr)); MD5Update(&ctx, (char *)&pd->dst->v6, sizeof(struct in6_addr)); @@ -3343,7 +3339,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, struct pf_krule *r, *a = NULL; struct pf_kruleset *ruleset = NULL; struct pf_ksrc_node *nsn = NULL; - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; struct pf_state_key *sk = NULL, *nk = NULL; u_short reason; int rewrite = 0, hdrlen = 0; @@ -3372,18 +3368,18 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, hdrlen = sizeof(*th); break; case IPPROTO_UDP: - sport = pd->hdr.udp->uh_sport; - dport = pd->hdr.udp->uh_dport; - hdrlen = sizeof(*pd->hdr.udp); + sport = pd->hdr.udp.uh_sport; + dport = pd->hdr.udp.uh_dport; + hdrlen = sizeof(pd->hdr.udp); break; #ifdef INET case IPPROTO_ICMP: if (pd->af != AF_INET) break; - sport = dport = pd->hdr.icmp->icmp_id; - hdrlen = sizeof(*pd->hdr.icmp); - icmptype = pd->hdr.icmp->icmp_type; - icmpcode = pd->hdr.icmp->icmp_code; + sport = dport = pd->hdr.icmp.icmp_id; + hdrlen = sizeof(pd->hdr.icmp); + icmptype = pd->hdr.icmp.icmp_type; + icmpcode = pd->hdr.icmp.icmp_code; if (icmptype == ICMP_UNREACH || icmptype == ICMP_SOURCEQUENCH || @@ -3397,10 +3393,10 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, case IPPROTO_ICMPV6: if (af != AF_INET6) break; - sport = dport = pd->hdr.icmp6->icmp6_id; - hdrlen = sizeof(*pd->hdr.icmp6); - icmptype = pd->hdr.icmp6->icmp6_type; - icmpcode = pd->hdr.icmp6->icmp6_code; + sport = dport = pd->hdr.icmp6.icmp6_id; + hdrlen = sizeof(pd->hdr.icmp6); + icmptype = pd->hdr.icmp6.icmp6_type; + icmpcode = pd->hdr.icmp6.icmp6_code; if (icmptype == ICMP6_DST_UNREACH || icmptype == ICMP6_PACKET_TOO_BIG || @@ -3450,27 +3446,27 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, rewrite++; break; case IPPROTO_UDP: - bproto_sum = pd->hdr.udp->uh_sum; - pd->proto_sum = &pd->hdr.udp->uh_sum; + bproto_sum = pd->hdr.udp.uh_sum; + pd->proto_sum = &pd->hdr.udp.uh_sum; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], af) || nk->port[pd->sidx] != sport) { - pf_change_ap(m, saddr, &pd->hdr.udp->uh_sport, - pd->ip_sum, &pd->hdr.udp->uh_sum, + pf_change_ap(m, saddr, &pd->hdr.udp.uh_sport, + pd->ip_sum, &pd->hdr.udp.uh_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 1, af); - sport = pd->hdr.udp->uh_sport; - pd->sport = &pd->hdr.udp->uh_sport; + sport = pd->hdr.udp.uh_sport; + pd->sport = &pd->hdr.udp.uh_sport; } if (PF_ANEQ(daddr, &nk->addr[pd->didx], af) || nk->port[pd->didx] != dport) { - pf_change_ap(m, daddr, &pd->hdr.udp->uh_dport, - pd->ip_sum, &pd->hdr.udp->uh_sum, + pf_change_ap(m, daddr, &pd->hdr.udp.uh_dport, + pd->ip_sum, &pd->hdr.udp.uh_sum, &nk->addr[pd->didx], nk->port[pd->didx], 1, af); - dport = pd->hdr.udp->uh_dport; - pd->dport = &pd->hdr.udp->uh_dport; + dport = pd->hdr.udp.uh_dport; + pd->dport = &pd->hdr.udp.uh_dport; } rewrite++; break; @@ -3485,25 +3481,25 @@ pf_test_rule(struct pf_krule **rm, struct pf_state **sm, int direction, pf_change_a(&daddr->v4.s_addr, pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (nk->port[1] != pd->hdr.icmp->icmp_id) { - pd->hdr.icmp->icmp_cksum = pf_cksum_fixup( - pd->hdr.icmp->icmp_cksum, sport, + if (nk->port[1] != pd->hdr.icmp.icmp_id) { + pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( + pd->hdr.icmp.icmp_cksum, sport, nk->port[1], 0); - pd->hdr.icmp->icmp_id = nk->port[1]; - pd->sport = &pd->hdr.icmp->icmp_id; + pd->hdr.icmp.icmp_id = nk->port[1]; + pd->sport = &pd->hdr.icmp.icmp_id; } - m_copyback(m, off, ICMP_MINLEN, (caddr_t)pd->hdr.icmp); + m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); break; #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: nk->port[0] = nk->port[1]; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], AF_INET6)) - pf_change_a6(saddr, &pd->hdr.icmp6->icmp6_cksum, + pf_change_a6(saddr, &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->sidx], 0); if (PF_ANEQ(daddr, &nk->addr[pd->didx], AF_INET6)) - pf_change_a6(daddr, &pd->hdr.icmp6->icmp6_cksum, + pf_change_a6(daddr, &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->didx], 0); rewrite++; break; @@ -3714,7 +3710,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, { struct pf_state *s = NULL; struct pf_ksrc_node *sn = NULL; - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; u_int16_t mss = V_tcp_mssdflt; u_short reason; @@ -4066,7 +4062,7 @@ pf_tcp_track_full(struct pf_state_peer *src, struct pf_state_peer *dst, struct pf_state **state, struct pfi_kkif *kif, struct mbuf *m, int off, struct pf_pdesc *pd, u_short *reason, int *copyback) { - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; u_int16_t win = ntohs(th->th_win); u_int32_t ack, end, seq, orig_seq; u_int8_t sws, dws; @@ -4395,7 +4391,7 @@ static int pf_tcp_track_sloppy(struct pf_state_peer *src, struct pf_state_peer *dst, struct pf_state **state, struct pf_pdesc *pd, u_short *reason) { - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; if (th->th_flags & TH_SYN) if (src->state < TCPS_SYN_SENT) @@ -4468,7 +4464,7 @@ pf_test_state_tcp(struct pf_state **state, int direction, struct pfi_kkif *kif, u_short *reason) { struct pf_state_key_cmp key; - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; int copyback = 0; struct pf_state_peer *src, *dst; struct pf_state_key *sk; @@ -4636,7 +4632,7 @@ pf_test_state_udp(struct pf_state **state, int direction, struct pfi_kkif *kif, { struct pf_state_peer *src, *dst; struct pf_state_key_cmp key; - struct udphdr *uh = pd->hdr.udp; + struct udphdr *uh = &pd->hdr.udp; bzero(&key, sizeof(key)); key.af = pd->af; @@ -4711,10 +4707,10 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, switch (pd->proto) { #ifdef INET case IPPROTO_ICMP: - icmptype = pd->hdr.icmp->icmp_type; - icmpcode = pd->hdr.icmp->icmp_code; - icmpid = pd->hdr.icmp->icmp_id; - icmpsum = &pd->hdr.icmp->icmp_cksum; + icmptype = pd->hdr.icmp.icmp_type; + icmpcode = pd->hdr.icmp.icmp_code; + icmpid = pd->hdr.icmp.icmp_id; + icmpsum = &pd->hdr.icmp.icmp_cksum; if (icmptype == ICMP_UNREACH || icmptype == ICMP_SOURCEQUENCH || @@ -4726,10 +4722,10 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: - icmptype = pd->hdr.icmp6->icmp6_type; - icmpcode = pd->hdr.icmp6->icmp6_code; - icmpid = pd->hdr.icmp6->icmp6_id; - icmpsum = &pd->hdr.icmp6->icmp6_cksum; + icmptype = pd->hdr.icmp6.icmp6_type; + icmpcode = pd->hdr.icmp6.icmp6_code; + icmpid = pd->hdr.icmp6.icmp6_id; + icmpsum = &pd->hdr.icmp6.icmp6_cksum; if (icmptype == ICMP6_DST_UNREACH || icmptype == ICMP6_PACKET_TOO_BIG || @@ -4782,17 +4778,17 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, nk->addr[pd->didx].v4.s_addr, 0); if (nk->port[0] != - pd->hdr.icmp->icmp_id) { - pd->hdr.icmp->icmp_cksum = + pd->hdr.icmp.icmp_id) { + pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( - pd->hdr.icmp->icmp_cksum, icmpid, + pd->hdr.icmp.icmp_cksum, icmpid, nk->port[pd->sidx], 0); - pd->hdr.icmp->icmp_id = + pd->hdr.icmp.icmp_id = nk->port[pd->sidx]; } m_copyback(m, off, ICMP_MINLEN, - (caddr_t )pd->hdr.icmp); + (caddr_t )&pd->hdr.icmp); break; #endif /* INET */ #ifdef INET6 @@ -4800,17 +4796,17 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], AF_INET6)) pf_change_a6(saddr, - &pd->hdr.icmp6->icmp6_cksum, + &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->sidx], 0); if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], AF_INET6)) pf_change_a6(daddr, - &pd->hdr.icmp6->icmp6_cksum, + &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->didx], 0); m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t )pd->hdr.icmp6); + (caddr_t )&pd->hdr.icmp6); break; #endif /* INET6 */ } @@ -5053,7 +5049,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, #ifdef INET case AF_INET: m_copyback(m, off, ICMP_MINLEN, - (caddr_t )pd->hdr.icmp); + (caddr_t )&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t )&h2); break; @@ -5062,7 +5058,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, case AF_INET6: m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t )pd->hdr.icmp6); + (caddr_t )&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t )&h2_6); break; @@ -5122,7 +5118,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, #ifdef INET case AF_INET: m_copyback(m, off, ICMP_MINLEN, - (caddr_t )pd->hdr.icmp); + (caddr_t )&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); break; #endif /* INET */ @@ -5130,7 +5126,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, case AF_INET6: m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t )pd->hdr.icmp6); + (caddr_t )&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t )&h2_6); break; @@ -5185,7 +5181,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); - m_copyback(m, off, ICMP_MINLEN, (caddr_t)pd->hdr.icmp); + m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); m_copyback(m, off2, ICMP_MINLEN, (caddr_t)&iih); } @@ -5238,7 +5234,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, pd->ip_sum, 0, AF_INET6); m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); + (caddr_t)&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t)&h2_6); m_copyback(m, off2, sizeof(struct icmp6_hdr), (caddr_t)&iih); @@ -5280,7 +5276,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, #ifdef INET case AF_INET: m_copyback(m, off, ICMP_MINLEN, - (caddr_t)pd->hdr.icmp); + (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); break; #endif /* INET */ @@ -5288,7 +5284,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kkif *kif, case AF_INET6: m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t )pd->hdr.icmp6); + (caddr_t )&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t )&h2_6); break; @@ -6117,16 +6113,13 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * switch (h->ip_p) { case IPPROTO_TCP: { - struct tcphdr th; - - pd.hdr.tcp = &th; - if (!pf_pull_hdr(m, off, &th, sizeof(th), + if (!pf_pull_hdr(m, off, &pd.hdr.tcp, sizeof(pd.hdr.tcp), &action, &reason, AF_INET)) { log = action != PF_PASS; goto done; } - pd.p_len = pd.tot_len - off - (th.th_off << 2); - if ((th.th_flags & TH_ACK) && pd.p_len == 0) + pd.p_len = pd.tot_len - off - (pd.hdr.tcp.th_off << 2); + if ((pd.hdr.tcp.th_flags & TH_ACK) && pd.p_len == 0) pqid = 1; action = pf_normalize_tcp(dir, kif, m, 0, off, h, &pd); if (action == PF_DROP) @@ -6146,17 +6139,14 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * } case IPPROTO_UDP: { - struct udphdr uh; - - pd.hdr.udp = &uh; - if (!pf_pull_hdr(m, off, &uh, sizeof(uh), + if (!pf_pull_hdr(m, off, &pd.hdr.udp, sizeof(pd.hdr.udp), &action, &reason, AF_INET)) { log = action != PF_PASS; goto done; } - if (uh.uh_dport == 0 || - ntohs(uh.uh_ulen) > m->m_pkthdr.len - off || - ntohs(uh.uh_ulen) < sizeof(struct udphdr)) { + if (pd.hdr.udp.uh_dport == 0 || + ntohs(pd.hdr.udp.uh_ulen) > m->m_pkthdr.len - off || + ntohs(pd.hdr.udp.uh_ulen) < sizeof(struct udphdr)) { action = PF_DROP; REASON_SET(&reason, PFRES_SHORT); goto done; @@ -6175,10 +6165,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * } case IPPROTO_ICMP: { - struct icmp ih; - - pd.hdr.icmp = &ih; - if (!pf_pull_hdr(m, off, &ih, ICMP_MINLEN, + if (!pf_pull_hdr(m, off, &pd.hdr.icmp, ICMP_MINLEN, &action, &reason, AF_INET)) { log = action != PF_PASS; goto done; @@ -6568,15 +6555,12 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb switch (pd.proto) { case IPPROTO_TCP: { - struct tcphdr th; - - pd.hdr.tcp = &th; - if (!pf_pull_hdr(m, off, &th, sizeof(th), + if (!pf_pull_hdr(m, off, &pd.hdr.tcp, sizeof(pd.hdr.tcp), &action, &reason, AF_INET6)) { log = action != PF_PASS; goto done; } - pd.p_len = pd.tot_len - off - (th.th_off << 2); + pd.p_len = pd.tot_len - off - (pd.hdr.tcp.th_off << 2); action = pf_normalize_tcp(dir, kif, m, 0, off, h, &pd); if (action == PF_DROP) goto done; @@ -6595,17 +6579,14 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb } case IPPROTO_UDP: { - struct udphdr uh; - - pd.hdr.udp = &uh; - if (!pf_pull_hdr(m, off, &uh, sizeof(uh), + if (!pf_pull_hdr(m, off, &pd.hdr.udp, sizeof(pd.hdr.udp), &action, &reason, AF_INET6)) { log = action != PF_PASS; goto done; } - if (uh.uh_dport == 0 || - ntohs(uh.uh_ulen) > m->m_pkthdr.len - off || - ntohs(uh.uh_ulen) < sizeof(struct udphdr)) { + if (pd.hdr.udp.uh_dport == 0 || + ntohs(pd.hdr.udp.uh_ulen) > m->m_pkthdr.len - off || + ntohs(pd.hdr.udp.uh_ulen) < sizeof(struct udphdr)) { action = PF_DROP; REASON_SET(&reason, PFRES_SHORT); goto done; @@ -6631,10 +6612,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb } case IPPROTO_ICMPV6: { - struct icmp6_hdr ih; - - pd.hdr.icmp6 = &ih; - if (!pf_pull_hdr(m, off, &ih, sizeof(ih), + if (!pf_pull_hdr(m, off, &pd.hdr.icmp6, sizeof(pd.hdr.icmp6), &action, &reason, AF_INET6)) { log = action != PF_PASS; goto done; diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index d8f8ae00fb8a..8160166edc95 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -182,7 +182,7 @@ pf_match_translation(struct pf_pdesc *pd, struct mbuf *m, int off, r = TAILQ_NEXT(r, entries); else if (r->os_fingerprint != PF_OSFP_ANY && (pd->proto != IPPROTO_TCP || !pf_osfp_match(pf_osfp_fingerprint(pd, m, - off, pd->hdr.tcp), r->os_fingerprint))) + off, &pd->hdr.tcp), r->os_fingerprint))) r = TAILQ_NEXT(r, entries); else { if (r->tag) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 8f970b68373b..b6e7fd5f1e1c 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1346,7 +1346,7 @@ pf_normalize_tcp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, int off, void *h, struct pf_pdesc *pd) { struct pf_krule *r, *rm = NULL; - struct tcphdr *th = pd->hdr.tcp; + struct tcphdr *th = &pd->hdr.tcp; int rewrite = 0; u_short reason; u_int8_t flags; From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 11:40:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 BE63A652420; Sat, 26 Jun 2021 11:40:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBsPq4yMbz4f6f; Sat, 26 Jun 2021 11:40:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 925AA1E145; Sat, 26 Jun 2021 11:40:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QBelND055841; Sat, 26 Jun 2021 11:40:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QBel74055840; Sat, 26 Jun 2021 11:40:47 GMT (envelope-from git) Date: Sat, 26 Jun 2021 11:40:47 GMT Message-Id: <202106261140.15QBel74055840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 363a2f5661b3 - stable/13 - zfs: merge openzfs/zfs@aee26af27 (zfs-2.1-release) into stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 363a2f5661b3ad079862bee56b86c08648ecc178 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 11:40:47 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=363a2f5661b3ad079862bee56b86c08648ecc178 commit 363a2f5661b3ad079862bee56b86c08648ecc178 Merge: c816b23784a6 aee26af277c9 Author: Martin Matuska AuthorDate: 2021-06-26 11:37:50 +0000 Commit: Martin Matuska CommitDate: 2021-06-26 11:38:37 +0000 zfs: merge openzfs/zfs@aee26af27 (zfs-2.1-release) into stable/13 Notable upstream pull request merges: #12172 Use wmsum for arc, abd, dbuf and zfetch statistics #12227 Revert Consolidate arc_buf allocation checks #12273 zfs_metaslab_mem_limit should be 25 instead of 75 #12266 Fix flag copying in resume case #12276 Update cache file when setting compatibility property Obtained from: OpenZFS OpenZFS commit: aee26af277c91abeb0e1cfe27cc48cc328fdb881 .../openzfs/.github/ISSUE_TEMPLATE/config.yml | 2 +- sys/contrib/openzfs/cmd/ztest/ztest.c | 4 +- .../openzfs/contrib/pam_zfs_key/pam_zfs_key.c | 12 +- sys/contrib/openzfs/include/sys/abd_impl.h | 4 +- sys/contrib/openzfs/include/sys/arc_impl.h | 119 +++- sys/contrib/openzfs/include/sys/crypto/api.h | 2 +- sys/contrib/openzfs/include/sys/dnode.h | 6 +- sys/contrib/openzfs/include/sys/zfs_debug.h | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 4 + sys/contrib/openzfs/lib/libzpool/kernel.c | 2 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 46 ++ .../openzfs/module/os/freebsd/zfs/zfs_debug.c | 2 +- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 9 +- sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 75 +++ sys/contrib/openzfs/module/os/linux/zfs/arc_os.c | 2 +- .../openzfs/module/os/linux/zfs/zfs_debug.c | 3 +- .../openzfs/module/os/linux/zfs/zio_crypt.c | 20 +- sys/contrib/openzfs/module/zfs/arc.c | 615 +++++++++++++++------ sys/contrib/openzfs/module/zfs/dbuf.c | 236 +++++--- sys/contrib/openzfs/module/zfs/dmu_objset.c | 2 +- sys/contrib/openzfs/module/zfs/dmu_recv.c | 44 +- sys/contrib/openzfs/module/zfs/dmu_tx.c | 3 +- sys/contrib/openzfs/module/zfs/dmu_zfetch.c | 47 +- sys/contrib/openzfs/module/zfs/dnode.c | 8 +- sys/contrib/openzfs/module/zfs/dnode_sync.c | 5 +- sys/contrib/openzfs/module/zfs/dsl_dataset.c | 4 +- sys/contrib/openzfs/module/zfs/dsl_destroy.c | 2 +- sys/contrib/openzfs/module/zfs/dsl_dir.c | 11 +- sys/contrib/openzfs/module/zfs/metaslab.c | 69 ++- sys/contrib/openzfs/module/zfs/mmp.c | 19 +- sys/contrib/openzfs/module/zfs/range_tree.c | 3 +- sys/contrib/openzfs/module/zfs/sa.c | 2 +- sys/contrib/openzfs/module/zfs/spa.c | 65 ++- sys/contrib/openzfs/module/zfs/spa_checkpoint.c | 13 +- sys/contrib/openzfs/module/zfs/spa_history.c | 9 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 2 +- sys/contrib/openzfs/module/zfs/space_map.c | 8 +- sys/contrib/openzfs/module/zfs/txg.c | 23 +- sys/contrib/openzfs/module/zfs/vdev.c | 5 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 7 +- sys/contrib/openzfs/module/zfs/vdev_removal.c | 21 +- sys/contrib/openzfs/module/zfs/zap.c | 8 +- sys/contrib/openzfs/module/zfs/zap_micro.c | 9 +- sys/contrib/openzfs/module/zfs/zcp.c | 3 +- sys/contrib/openzfs/module/zfs/zil.c | 5 +- sys/contrib/openzfs/module/zfs/zio.c | 40 +- sys/contrib/openzfs/tests/runfiles/common.run | 3 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 3 + .../openzfs/tests/zfs-tests/include/commands.cfg | 1 - .../functional/cli_root/zpool_create/Makefile.am | 1 + .../zpool_create/zpool_create_features_009_pos.ksh | 92 +++ .../functional/redacted_send/redacted_embedded.ksh | 4 +- .../zfs-tests/tests/functional/rsend/rsend.kshlib | 12 +- .../functional/rsend/send-c_embedded_blocks.ksh | 10 +- .../tests/functional/rsend/send-c_zstreamdump.ksh | 12 +- .../functional/rsend/send-cpL_varied_recsize.ksh | 2 +- sys/modules/zfs/zfs_config.h | 4 +- 57 files changed, 1276 insertions(+), 470 deletions(-) diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_009_pos.ksh index 000000000000,052c18dcee2b..052c18dcee2b mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_009_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_009_pos.ksh diff --cc sys/modules/zfs/zfs_config.h index 59041ba82b69,000000000000..0080a6c775e9 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,774 -1,0 +1,774 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT_LEGACY */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* kernel has large stacks */ +/* #undef HAVE_LARGE_STACKS */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* iops->create()/mkdir()/mknod() take umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() is available */ +/* #undef HAVE_SETATTR_PREPARE */ + +/* iops->set_acl() exists */ +/* #undef HAVE_SET_ACL */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* ->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes a vfsmount */ +/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */ + +/* aops->direct_IO() uses iovec */ +/* #undef HAVE_VFS_DIRECT_IO_IOVEC */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* aops->direct_IO() uses iov_iter with rw and offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + +/* fops->iterate() is available */ +/* #undef HAVE_VFS_ITERATE */ + +/* fops->iterate_shared() is available */ +/* #undef HAVE_VFS_ITERATE_SHARED */ + +/* fops->readdir() is available */ +/* #undef HAVE_VFS_READDIR */ + +/* fops->read/write_iter() are available */ +/* #undef HAVE_VFS_RW_ITERATE */ + +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* yes */ +/* #undef HAVE_WAIT_ON_BIT_ACTION */ + +/* wait_queue_entry_t exists */ +/* #undef HAVE_WAIT_QUEUE_ENTRY_T */ + +/* wq_head->head and wq_entry->entry exist */ +/* #undef HAVE_WAIT_QUEUE_HEAD_ENTRY */ + +/* xattr_handler->get() wants dentry */ +/* #undef HAVE_XATTR_GET_DENTRY */ + +/* xattr_handler->get() wants both dentry and inode */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE */ + +/* xattr_handler->get() wants xattr_handler */ +/* #undef HAVE_XATTR_GET_HANDLER */ + +/* xattr_handler has name */ +/* #undef HAVE_XATTR_HANDLER_NAME */ + +/* xattr_handler->list() wants dentry */ +/* #undef HAVE_XATTR_LIST_DENTRY */ + +/* xattr_handler->list() wants xattr_handler */ +/* #undef HAVE_XATTR_LIST_HANDLER */ + +/* xattr_handler->list() wants simple */ +/* #undef HAVE_XATTR_LIST_SIMPLE */ + +/* xattr_handler->set() wants dentry */ +/* #undef HAVE_XATTR_SET_DENTRY */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() wants xattr_handler */ +/* #undef HAVE_XATTR_SET_HANDLER */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* __posix_acl_chmod() exists */ +/* #undef HAVE___POSIX_ACL_CHMOD */ + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* hardened module_param_call */ +/* #undef MODULE_PARAM_CALL_CONST */ + +/* struct shrink_control has nid */ +/* #undef SHRINK_CONTROL_HAS_NID */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE + +/* Defined for legacy compatibility. */ +#define SPL_META_VERSION ZFS_META_VERSION + +/* True if ZFS is to be compiled for a FreeBSD system */ +#define SYSTEM_FREEBSD 1 + +/* True if ZFS is to be compiled for a Linux system */ +/* #undef SYSTEM_LINUX */ + +/* zfs debugging enabled */ +/* #undef ZFS_DEBUG */ + +/* /dev/zfs minor */ +/* #undef ZFS_DEVICE_MINOR */ + +/* enum node_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum node_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum node_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* enum zone_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum zone_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum zone_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* global_node_page_state() exists */ +/* #undef ZFS_GLOBAL_NODE_PAGE_STATE */ + +/* global_zone_page_state() exists */ +/* #undef ZFS_GLOBAL_ZONE_PAGE_STATE */ + +/* Define to 1 if GPL-only symbols can be used */ +/* #undef ZFS_IS_GPL_COMPATIBLE */ + +/* Define the project alias string. */ - #define ZFS_META_ALIAS "zfs-2.1.0-FreeBSD_g9a865b7fb" ++#define ZFS_META_ALIAS "zfs-2.1.0-FreeBSD_gaee26af27" + +/* Define the project author. */ +#define ZFS_META_AUTHOR "OpenZFS" + +/* Define the project release date. */ +/* #undef ZFS_META_DATA */ + +/* Define the maximum compatible kernel version. */ +#define ZFS_META_KVER_MAX "5.12" + +/* Define the minimum compatible kernel version. */ +#define ZFS_META_KVER_MIN "3.10" + +/* Define the project license. */ +#define ZFS_META_LICENSE "CDDL" + +/* Define the libtool library 'age' version information. */ +/* #undef ZFS_META_LT_AGE */ + +/* Define the libtool library 'current' version information. */ +/* #undef ZFS_META_LT_CURRENT */ + +/* Define the libtool library 'revision' version information. */ +/* #undef ZFS_META_LT_REVISION */ + +/* Define the project name. */ +#define ZFS_META_NAME "zfs" + +/* Define the project release. */ - #define ZFS_META_RELEASE "FreeBSD_g9a865b7fb" ++#define ZFS_META_RELEASE "FreeBSD_gaee26af27" + +/* Define the project version. */ +#define ZFS_META_VERSION "2.1.0" + +/* count is located in percpu_ref.data */ +/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ + From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 13:37:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 5F9606541CE for ; Sat, 26 Jun 2021 13:37:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBw052J0bz4lk2; Sat, 26 Jun 2021 13:37:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 1674F22479; Sat, 26 Jun 2021 13:37:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (unknown [IPv6:2001:470:7a58:0:fdde:db3b:9e58:fdb3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D13F3503FD; Sat, 26 Jun 2021 15:37:06 +0200 (CEST) From: Dimitry Andric Message-Id: <62DD1D7C-68FA-4931-A219-2C90A97A56A7@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_3B5EC8AB-C527-4078-B664-D7E8181F4659"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: 450f3e55bdad - stable/13 - Work around bogus old gcc "initializer element is not constant" error Date: Sat, 26 Jun 2021 15:36:54 +0200 In-Reply-To: <87104032-C5B9-447D-9545-B30AF983ACB7@yahoo.com> Cc: dev-commits-src-branches@freebsd.org To: Mark Millard References: <87104032-C5B9-447D-9545-B30AF983ACB7.ref@yahoo.com> <87104032-C5B9-447D-9545-B30AF983ACB7@yahoo.com> X-Mailer: Apple Mail (2.3654.100.0.2.22) X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 13:37:09 -0000 --Apple-Mail=_3B5EC8AB-C527-4078-B664-D7E8181F4659 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 26 Jun 2021, at 06:11, Mark Millard wrote: >=20 > Dimitry Andric dim at FreeBSD.org wrote on > Fri Jun 25 18:46:00 UTC 2021 : >=20 > . . . >> In file included from /workspace/src/lib/msun/src/s_llround.c:11:0: >> /workspace/src/lib/msun/src/s_lround.c:54:31: error: initializer = element is not constant >> static const type dtype_min =3D type_min - 0.5; >> ^~~~~~~~ >> /workspace/src/lib/msun/src/s_lround.c:55:31: error: initializer = element is not constant >> static const type dtype_max =3D type_max + 0.5; >> ^~~~~~~~ >>=20 >> Since 'type_min' and 'type_max' are constants declared just above = these >> lines this error is nonsensical, but older gcc's are not smart = enough. > . . . >=20 > Well, in C "const" historically means closer to "read-only" than > to is-a-constant-expression in the language, unfortunately. Part > of this is the conversion away from being an lvalue (so: where > an lvalue is not required) loses the const qualification as part > of the conversion. FWIW, this changed in gcc 8.1+, here: = https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dcommit;h=3Df9c59f7e9511856bd6dc13= d2d4904ebd9249c095 referencing these bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66618 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69960 In one of the comments, joseph@codesourcery.com mentions: > Although diagnosing this probably makes sense, it's not required by = the > standard ("An implementation may accept other forms of constant > expressions." - and this expression doesn't contain "assignment, > increment, decrement, function-call, or comma operators", so isn't > required by the Constraints for constant expressions not to be one). I guess the gcc people also decided that POLA applied here. :) -Dimitry --Apple-Mail=_3B5EC8AB-C527-4078-B664-D7E8181F4659 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYNctdgAKCRCwXqMKLiCW oyaBAKCIxLTfSv2mK433xEngt8cL7h8RwACfXQSraD/vRSxylfCnPel9wcMtvPw= =7uA2 -----END PGP SIGNATURE----- --Apple-Mail=_3B5EC8AB-C527-4078-B664-D7E8181F4659-- From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 15:30:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 A78F76555E5 for ; Sat, 26 Jun 2021 15:30:25 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-23.consmr.mail.gq1.yahoo.com (sonic312-23.consmr.mail.gq1.yahoo.com [98.137.69.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GByVn2qpwz4ryb for ; Sat, 26 Jun 2021 15:30:25 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1624721424; bh=SQPZIwzayc4la3lWBZ8ebTmoWfkB8lDLR0HOmMowr2g=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=GO5svVjFWAsHrTtMvFSaL8zz6v8qzmZSEtARtU7zsPHVbQCAn21mXKitg9by1tp/3Vmev8U9U8PC4Mw+R4aKsrbiCxiB86LoiXD55ZKWSm3zIMfx+ls0SVki73RQREhS+YhS/5cMwyGBHpO7s5uwjsOXO50vf9NnrFJt9h1JctR1c5P2UkBl2ufx5XoiJfY0SGDusx2R+cpN/ddZb2jcYubgMtc2Bg1epzNGaXsfW3syT+WHkrqezwT+BMynzfg1Gh7ppMiZKsAnAiCWfNuxYD4Yx4IHKk4Tc/Zf2YpwNOBHzf54v55inJt2PWXWfWlFrxwkkLw1hQ0aYMydSrMYAQ== X-YMail-OSG: m80T778VM1kowx7XjwDD4PnP2A9taluCmhjRfeKK3nWCVxpxNnK0Pj2.W.Dt6Pa BfBy5ORsmhPjE5e9Qyq0PYg2M3c0WqVB0UAiwzg2jHV14KNxZ9cvZD4AXGqE.0mIigX9p12zTi6z vYNtnnHdxLG3KWtNWeC4coV6JIKuUK9zrHb_QGfInx2go.634cb4JdL0fwvDu7MDw8GXADAT4G.b oZlx35gzBhvdeAx5iOfAtLNvw1bLhW80DjHyACN2Sm3bAQgC8TDKS_sqMwMqg5hF7qp5U1VvEWFh hqmvlCcT0bh4upaECGyEwA9AMt.KPwBVbvaqJv9w6pAi9PuPZR34iCpezP0WUKyhSPPd8dL2nWai ut78oBxpZ8KJda_J4VJjOmdNLlep61a1UEjQhoIA4xEOdgbEd61izKcsDUsoRlsCyimv5ahtCr7Z aBsPXms9C6PeazrWOhTCePemaQIsNBOtKJQzBEdekGO09GfYxDIb9686xb1m.jdSIY3UCo_BtOKz 0G0Us9ML0EZwKFgTFK3s0rxgzQRtV72OWOYfaXYgrWCV_YCjbwNshoRyf4Z3g9yaHkp0.bymXd_1 .BFx0z6GmQUUqE50B_PpWjfs7kuH.K6pvKq2UnQMNtrgp6EcJ76LaLQmTbVkV84DStdYypZsATGr 8H_3DOxzQVNEiDZayzizIXoLmF9U4Cv6Jup27EKXlz6mlPo8J7kI9r2zFVKdMYzjB551XKou0IMK H4WXvai0jCy2_Yxn7iNuotCH5OfsFOE37RJTPWAptBDAYeyiPVxLHUPAcPXqR7qeKvTrVrjCvrY1 nXcPIo2bpZYZT3ZQkSUvnMCPIIm4UQCqB1WBu7IyVbFc7J71DegJ.relFUmn9GyqCSaaE3m5.AvE JWTQrQJ.U3ZkF8F6a8Z0PIH5Hi9JCWr_6bHcByXhL6OsOKaWv3hLur8o3v0dvPdwuaiJOTek.One COiDFy8jrpuhKzvH3TfneX31o7qwf6S8LEADEmrr71KV.ME0NO4FIEAoiaxwiDGODEhAD6QHBO_H ePsJMCnI7G1hGW70iwSgGVDtER4Hi.fWQe_MkAuGaDZZqTs3SwG4upks_YYhpEd7hB3wwfRQmAg9 Ik9PlXBK1bAmkDQZ7bWBl0dlsrl1ZGGAOGb2tl1SxGLJ6Hc7WDF4aVMUAwFaStiF0iCbbF415tcu m9ocmQ9OG36yAO8g3GPRgKvel1DGyj27opwTrLdFXvX6nchZB9LfCfpI2H06VzUv_DQm35mkee1h E3zpZA5skQteXVatM17aKUZqd__U0CkNi5f4V4ca8_m0BnnMwWDENGPK1eKEB6xCd1Q0T8fLsCTu PvCXgymrUdzipW1ofBF5fmFZ.Q4Vk0dLVF84Fwm8W_lZ0.oFZzmyb462refU9P.ROBLLxzY_UQmp Y2SX_09epY6eI67yx1KaFPbGWbhQjakiNZg3tsKHre.B59Akd8kLyPwRxMX5lMEzFUL99qAg888s JK3ygmEtk.tzrNhbAHMVyOpXYAWoMnmm_T7O7C4.H2sZvgEBfqM9KV_KlLKylYQGS.Pjtl5_DIb6 u3O9gGTUBu.iRtEYojIJE8Ty_.zz.sTb9K6nMciNhC0wwq0IUCxXpASGwVCu92QRaBrfbF8uWgGR ezhMQS6YtPw27xevos2D4oTLg_szhiu.rg0tAdqxf6Yag5gKl4VPIsRX5ATS5MNr2Xy7xJsscwEE JtbNyXIfJN36bmc_nzN8JYJuV3jjD6vxlVYSuNzPgkZXftVhStOS5CFZayFYoH9kXLL3TiEs226n IMn0e0ip9pdLic2y2u8MEaPeUnDg3ol73RDyBOGfTa_zGBDRXIARbtdQZzjjafVe.Y9U2oknNvj1 QaTIYeXZJNM9.laMqYCpyiGiZEhinVCTFTCMJlcZGszhyLM0rGJRS2ZJLB8e0EwEHE3z4I6pbNZX TXv8nEprKLrj6j_MjvI2IyO4WYj9Cs767fw5BPjpqdWOEfGv6_bvW6kHuaeM6XgEICPKmAIoOIzs HNdivQDQMdP_5FcowPyUBoKzfM2CQ6eNaArlLLlJy0CIzihJIQ.dxczdnkTgOgem.B0KD4YGSRvx 2uoMj.TKWMgN5Pt1NWWB0wOWwjTRpeRhcYX7XUytB_1.KlUzdvrO.Fht3h737uISEpy0tsGmKW_D 6l0V99IUCd1t1PtG34DGIwV2Z_WMP1bc1gSF3dFC7_NvWpUPndl_aW9ZXm74nS0euHRhKLLdz2J7 gV3hH2izMLMLvmrJWx2.eUqUVhEiCuRCK_rrKRE0b0bVOz7QfwylINENy5KBX4RfQ_6sf83o_8Ls IOMs8VgYgE_ISR3muSJBn5ym_W2dyaRidmYcVqtFiMbsUGWJ.3FvbIPIA_iHF8Wiy8cvZ_9yNMkA FE.JtqEe_YeLaz7aGhW7iWsiI2JBQf.3tMfmiyDHVbXSjl.W1zi9jj17eezqEQNLfU.860LKfWgC m_RWTwRQIumsoZECfqSBxeYoIv0dE3r_YNACE_fVNDddevDdreKnSUAOB2slH25FdEETfgYgce5D f.iQ3fM90ypOpO_kypcUAMAZuZdkO38e8HgAi4o20ggrlDgiMhxiAhFJ8N4XL5qPdyNuXQuB6rTl 4wKquBJ9lGZQ- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Sat, 26 Jun 2021 15:30:24 +0000 Received: by kubenode543.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID a002ee8e47a3d36b91e0744a3a48ac7b; Sat, 26 Jun 2021 15:30:19 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: 450f3e55bdad - stable/13 - Work around bogus old gcc "initializer element is not constant" error From: Mark Millard In-Reply-To: <62DD1D7C-68FA-4931-A219-2C90A97A56A7@FreeBSD.org> Date: Sat, 26 Jun 2021 08:30:17 -0700 Cc: dev-commits-src-branches@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <87104032-C5B9-447D-9545-B30AF983ACB7.ref@yahoo.com> <87104032-C5B9-447D-9545-B30AF983ACB7@yahoo.com> <62DD1D7C-68FA-4931-A219-2C90A97A56A7@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4GByVn2qpwz4ryb X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 15:30:25 -0000 On 2021-Jun-26, at 06:36, Dimitry Andric wrote: > On 26 Jun 2021, at 06:11, Mark Millard wrote: >>=20 >> Dimitry Andric dim at FreeBSD.org wrote on >> Fri Jun 25 18:46:00 UTC 2021 : >>=20 >> . . . >>> In file included from /workspace/src/lib/msun/src/s_llround.c:11:0: >>> /workspace/src/lib/msun/src/s_lround.c:54:31: error: initializer = element is not constant >>> static const type dtype_min =3D type_min - 0.5; >>> ^~~~~~~~ >>> /workspace/src/lib/msun/src/s_lround.c:55:31: error: initializer = element is not constant >>> static const type dtype_max =3D type_max + 0.5; >>> ^~~~~~~~ >>>=20 >>> Since 'type_min' and 'type_max' are constants declared just above = these >>> lines this error is nonsensical, but older gcc's are not smart = enough. >> . . . >>=20 >> Well, in C "const" historically means closer to "read-only" than >> to is-a-constant-expression in the language, unfortunately. Part >> of this is the conversion away from being an lvalue (so: where >> an lvalue is not required) loses the const qualification as part >> of the conversion. >=20 > FWIW, this changed in gcc 8.1+, here: > = https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dcommit;h=3Df9c59f7e9511856bd6dc13= d2d4904ebd9249c095 >=20 > referencing these bugs: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66618 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69960 >=20 > In one of the comments, joseph@codesourcery.com mentions: >> Although diagnosing this probably makes sense, it's not required by = the >> standard ("An implementation may accept other forms of constant >> expressions." - and this expression doesn't contain "assignment, >> increment, decrement, function-call, or comma operators", so isn't >> required by the Constraints for constant expressions not to be one). >=20 > I guess the gcc people also decided that POLA applied here. :) Yea. If one wants one's C code to reliably compile in valid C compilers generally, one must avoid treating such things as type_min in: static const type type_min =3D (type)DTYPE_MIN; as any of an integer, floating, enumeration, or character constant (in C terms). (C++ used the likes of "integer literal" as terminology to avoid the ambiguity that makes "integer constant" read funny vs. what is a constant expression.) Otherwise some compilers may reject the code without violating the language standard. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 16:27:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 C49F46563C1; Sat, 26 Jun 2021 16:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBzmR5GM6z3Clq; Sat, 26 Jun 2021 16:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CDCD21D78; Sat, 26 Jun 2021 16:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QGRJ8h034911; Sat, 26 Jun 2021 16:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QGRJGf034910; Sat, 26 Jun 2021 16:27:19 GMT (envelope-from git) Date: Sat, 26 Jun 2021 16:27:19 GMT Message-Id: <202106261627.15QGRJGf034910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 9aee734554e8 - stable/13 - amd64: typo fix: memcmpy -> memcmp in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9aee734554e847b0e456bf2109b1bc4d9f2f09fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 16:27:19 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=9aee734554e847b0e456bf2109b1bc4d9f2f09fd commit 9aee734554e847b0e456bf2109b1bc4d9f2f09fd Author: Mateusz Guzik AuthorDate: 2021-06-26 03:57:47 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-26 16:27:06 +0000 amd64: typo fix: memcmpy -> memcmp in a comment Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 9a8e4527f07dbb356bb1942efc09888f957df056) --- sys/amd64/amd64/support.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 9272870e9c5e..15f72a425cf1 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -82,7 +82,7 @@ ENTRY(pagecopy) END(pagecopy) /* - * memcmpy(b1, b2, len) + * memcmp(b1, b2, len) * rdi,rsi,rdx */ ENTRY(memcmp) From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 16:28:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 0A6D7656257; Sat, 26 Jun 2021 16:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBznc6t8rz3Cct; Sat, 26 Jun 2021 16:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4B9E2200F; Sat, 26 Jun 2021 16:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QGSKWG035133; Sat, 26 Jun 2021 16:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QGSKa2035132; Sat, 26 Jun 2021 16:28:20 GMT (envelope-from git) Date: Sat, 26 Jun 2021 16:28:20 GMT Message-Id: <202106261628.15QGSKa2035132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: d4f253ea50f7 - stable/12 - sys/dev/md: Drop unncessary __GLOBL(mfs_root) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d4f253ea50f7682f72d3f86bcc9019089dae096c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 16:28:21 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d4f253ea50f7682f72d3f86bcc9019089dae096c commit d4f253ea50f7682f72d3f86bcc9019089dae096c Author: Alex Richardson AuthorDate: 2021-03-30 13:53:41 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-26 15:52:06 +0000 sys/dev/md: Drop unncessary __GLOBL(mfs_root) LLVM12 complains if you change the symbol binding: error: mfs_root_end changed binding to STB_WEAK [-Werror,-Winline-asm] error: mfs_root changed binding to STB_WEAK [-Werror,-Winline-asm] (cherry picked from commit 69e18c9b7b12e7fd97a740d8748d8718021a1e34) --- sys/dev/md/md.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index e134e8e94b69..9e795a4a933b 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -188,8 +188,6 @@ int mfs_root_size; #else extern volatile u_char __weak_symbol mfs_root; extern volatile u_char __weak_symbol mfs_root_end; -__GLOBL(mfs_root); -__GLOBL(mfs_root_end); #define mfs_root_size ((uintptr_t)(&mfs_root_end - &mfs_root)) #endif #endif From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 16:28:22 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 2D303656413; Sat, 26 Jun 2021 16:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBznf0P0Vz3CrW; Sat, 26 Jun 2021 16:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E910421F63; Sat, 26 Jun 2021 16:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QGSLW4035162; Sat, 26 Jun 2021 16:28:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QGSL4K035161; Sat, 26 Jun 2021 16:28:21 GMT (envelope-from git) Date: Sat, 26 Jun 2021 16:28:21 GMT Message-Id: <202106261628.15QGSL4K035161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: f2ef124469ae - stable/12 - linker_set: fix globl/weak symbol redefinitions to work on clang 12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f2ef124469aef4ba17fb201d5412b04cc298bd2a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 16:28:22 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f2ef124469aef4ba17fb201d5412b04cc298bd2a commit f2ef124469aef4ba17fb201d5412b04cc298bd2a Author: Greg V AuthorDate: 2021-04-20 00:47:15 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-26 15:52:06 +0000 linker_set: fix globl/weak symbol redefinitions to work on clang 12 In clang 12.0.0.rc2, going from weak to global is now a hard error: ``` /usr/src/stand/libsa/amd64/_setjmp.S:67:25: error: _longjmp changed binding to STB_GLOBAL .text; .p2align 4,0x90; .globl _longjmp; .type _longjmp,@function; _longjmp:; .cfi_startproc ``` And the other way is a warning, but we have -Werror: ``` error: __start_set_Xcommand_set changed binding to STB_WEAK [-Werror,-Winline-asm] error: __stop_set_Xcommand_set changed binding to STB_WEAK [-Werror,-Winline-asm] ``` ref: https://reviews.llvm.org/D90108 Reviewed By: arichardson MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29159 (cherry picked from commit 32231805fbe2b9438c2de50c229b43c016207a08) --- sys/sys/cdefs.h | 4 ++-- sys/sys/linker_set.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index a2625a1ed5b4..c8485fa58f54 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -569,8 +569,8 @@ #endif /* __STDC__ */ #endif /* __GNUC__ || __INTEL_COMPILER */ -#define __GLOBL1(sym) __asm__(".globl " #sym) -#define __GLOBL(sym) __GLOBL1(sym) +#define __GLOBL(sym) __asm__(".globl " __XSTRING(sym)) +#define __WEAK(sym) __asm__(".weak " __XSTRING(sym)) #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h index 9f49b802887b..b67ed51551a6 100644 --- a/sys/sys/linker_set.h +++ b/sys/sys/linker_set.h @@ -57,8 +57,8 @@ */ #ifdef __GNUCLIKE___SECTION #define __MAKE_SET_QV(set, sym, qv) \ - __GLOBL(__CONCAT(__start_set_,set)); \ - __GLOBL(__CONCAT(__stop_set_,set)); \ + __WEAK(__CONCAT(__start_set_,set)); \ + __WEAK(__CONCAT(__stop_set_,set)); \ static void const * qv \ __set_##set##_sym_##sym __section("set_" #set) \ __used = &(sym) From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 16:28:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 70C8765604A; Sat, 26 Jun 2021 16:28:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBzng1sgvz3CmC; Sat, 26 Jun 2021 16:28:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1984C21D79; Sat, 26 Jun 2021 16:28:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QGSN0q035188; Sat, 26 Jun 2021 16:28:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QGSNE2035187; Sat, 26 Jun 2021 16:28:23 GMT (envelope-from git) Date: Sat, 26 Jun 2021 16:28:23 GMT Message-Id: <202106261628.15QGSNE2035187@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 38dc5ed3cee4 - stable/12 - amd64: add missing ALIGN_TEXT to loops in memset and memmove MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 38dc5ed3cee4b2aec04becba9042a0272609325d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 16:28:23 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=38dc5ed3cee4b2aec04becba9042a0272609325d commit 38dc5ed3cee4b2aec04becba9042a0272609325d Author: Mateusz Guzik AuthorDate: 2021-01-29 15:09:14 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-26 15:52:36 +0000 amd64: add missing ALIGN_TEXT to loops in memset and memmove (cherry picked from commit 164c3b81848bc81dc200b12370999474225447a3) --- lib/libc/amd64/string/memmove.S | 2 ++ lib/libc/amd64/string/memset.S | 1 + sys/amd64/amd64/support.S | 3 +++ 3 files changed, 6 insertions(+) diff --git a/lib/libc/amd64/string/memmove.S b/lib/libc/amd64/string/memmove.S index accc86440610..4797140a1c16 100644 --- a/lib/libc/amd64/string/memmove.S +++ b/lib/libc/amd64/string/memmove.S @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq (%rsi),%rdx movq %rdx,(%rdi) @@ -198,6 +199,7 @@ __FBSDID("$FreeBSD$"); cmpq $32,%rcx jb 2016f + ALIGN_TEXT 2032: movq (%rsi),%rdx movq %rdx,(%rdi) diff --git a/lib/libc/amd64/string/memset.S b/lib/libc/amd64/string/memset.S index 67f21714b3d1..0639573a4a3e 100644 --- a/lib/libc/amd64/string/memset.S +++ b/lib/libc/amd64/string/memset.S @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq %r10,(%rdi) movq %r10,8(%rdi) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 906e52b81db7..6fd123e94377 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -322,6 +322,7 @@ END(memcmp) cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq (%rsi),%rdx movq %rdx,(%rdi) @@ -455,6 +456,7 @@ END(memcmp) cmpq $32,%rcx jb 2016f + ALIGN_TEXT 2032: movq (%rsi),%rdx movq %rdx,(%rdi) @@ -595,6 +597,7 @@ END(memcpy_erms) cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq %r10,(%rdi) movq %r10,8(%rdi) From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 16:28:24 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 CEAD765604D; Sat, 26 Jun 2021 16:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBznh2tcfz3CZx; Sat, 26 Jun 2021 16:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3623321F64; Sat, 26 Jun 2021 16:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QGSOdT035212; Sat, 26 Jun 2021 16:28:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QGSOHu035211; Sat, 26 Jun 2021 16:28:24 GMT (envelope-from git) Date: Sat, 26 Jun 2021 16:28:24 GMT Message-Id: <202106261628.15QGSOHu035211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: d73c3e47df16 - stable/12 - amd64: tidy up pagezero*/pagecopy (movq -> movl) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d73c3e47df16f4d1a383e495326d8bfd28a2c3a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 16:28:25 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d73c3e47df16f4d1a383e495326d8bfd28a2c3a0 commit d73c3e47df16f4d1a383e495326d8bfd28a2c3a0 Author: Mateusz Guzik AuthorDate: 2019-05-12 07:11:44 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-26 15:54:08 +0000 amd64: tidy up pagezero*/pagecopy (movq -> movl) Sponsored by: The FreeBSD Foundation (cherry picked from commit b72515e129f6320eb43e0ee853fcbb099b300e57) --- sys/amd64/amd64/support.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 6fd123e94377..93d2d17150cc 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -48,7 +48,7 @@ /* Address: %rdi */ ENTRY(pagezero_std) PUSH_FRAME_POINTER - movq $PAGE_SIZE/8,%rcx + movl $PAGE_SIZE/8,%ecx xorl %eax,%eax rep stosq @@ -58,7 +58,7 @@ END(pagezero_std) ENTRY(pagezero_erms) PUSH_FRAME_POINTER - movq $PAGE_SIZE,%rcx + movl $PAGE_SIZE,%ecx xorl %eax,%eax rep stosb @@ -71,7 +71,7 @@ END(pagezero_erms) */ ENTRY(pagecopy) PUSH_FRAME_POINTER - movq $PAGE_SIZE/8,%rcx + movl $PAGE_SIZE/8,%ecx movq %rdi,%r9 movq %rsi,%rdi movq %r9,%rsi From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 16:28:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 8A0DC655C71; Sat, 26 Jun 2021 16:28:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBznj3Nbbz3Ch2; Sat, 26 Jun 2021 16:28:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B95522180; Sat, 26 Jun 2021 16:28:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QGSPDb035236; Sat, 26 Jun 2021 16:28:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QGSPg1035235; Sat, 26 Jun 2021 16:28:25 GMT (envelope-from git) Date: Sat, 26 Jun 2021 16:28:25 GMT Message-Id: <202106261628.15QGSPg1035235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: a3503647f776 - stable/12 - amd64: move memcmp checks upfront MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a3503647f776a96ae8e65b6225cc4f29ad573bf9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 16:28:25 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a3503647f776a96ae8e65b6225cc4f29ad573bf9 commit a3503647f776a96ae8e65b6225cc4f29ad573bf9 Author: Mateusz Guzik AuthorDate: 2021-01-31 15:46:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-26 15:54:58 +0000 amd64: move memcmp checks upfront This is a tradeoff which saves jumps for smaller sizes while making the 8-16 range slower (roughly in line with the other cases). Tested with glibc test suite. For example size 3 (most common with vfs namecache) (ops/s): before: 407086026 after: 461391995 The regressed range of 8-16 (with 8 as example): before: 540850489 after: 461671032 (cherry picked from commit f1be262ec11c1c35e6485f432415b5b52adb505d) --- lib/libc/amd64/string/memcmp.S | 50 ++++++++++++++++++++++------------------ sys/amd64/amd64/support.S | 52 +++++++++++++++++++++++------------------- 2 files changed, 57 insertions(+), 45 deletions(-) diff --git a/lib/libc/amd64/string/memcmp.S b/lib/libc/amd64/string/memcmp.S index 231ab2175804..04c32bebe439 100644 --- a/lib/libc/amd64/string/memcmp.S +++ b/lib/libc/amd64/string/memcmp.S @@ -39,9 +39,25 @@ ENTRY(memcmp) cmpq $16,%rdx ja 101632f -100816: cmpb $8,%dl - jl 100408f + jg 100816f + + cmpb $4,%dl + jg 100408f + + cmpb $2,%dl + jge 100204f + + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + subl %r8d,%eax +100000: + ret + + ALIGN_TEXT +100816: movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 @@ -51,9 +67,8 @@ ENTRY(memcmp) cmpq %r8,%r9 jne 10081608f ret + ALIGN_TEXT 100408: - cmpb $4,%dl - jl 100204f movl (%rdi),%r8d movl (%rsi),%r9d cmpl %r8d,%r9d @@ -63,9 +78,8 @@ ENTRY(memcmp) cmpl %r8d,%r9d jne 10040804f ret + ALIGN_TEXT 100204: - cmpb $2,%dl - jl 100001f movzwl (%rdi),%r8d movzwl (%rsi),%r9d cmpl %r8d,%r9d @@ -75,15 +89,7 @@ ENTRY(memcmp) cmpl %r8d,%r9d jne 1f ret -100001: - cmpb $1,%dl - jl 100000f - movzbl (%rdi),%eax - movzbl (%rsi),%r8d - subl %r8d,%eax -100000: - ret -ALIGN_TEXT + ALIGN_TEXT 101632: cmpq $32,%rdx ja 103200f @@ -104,7 +110,7 @@ ALIGN_TEXT cmpq %r8,%r9 jne 10163224f ret -ALIGN_TEXT + ALIGN_TEXT 103200: movq (%rdi),%r8 movq 8(%rdi),%r9 @@ -134,7 +140,7 @@ ALIGN_TEXT * * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). */ -ALIGN_TEXT + ALIGN_TEXT 10320016: leaq 16(%rdi),%rdi leaq 16(%rsi),%rsi @@ -146,29 +152,29 @@ ALIGN_TEXT leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10081608: 10163224: leaq -8(%rdi,%rdx),%rdi leaq -8(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163216: leaq -16(%rdi,%rdx),%rdi leaq -16(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163208: leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10040804: leaq -4(%rdi,%rdx),%rdi leaq -4(%rsi,%rdx),%rsi jmp 1f -ALIGN_TEXT + ALIGN_TEXT 80: movl (%rdi),%r8d movl (%rsi),%r9d diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 93d2d17150cc..1a08315c2c46 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -117,9 +117,26 @@ ENTRY(memcmp) cmpq $16,%rdx ja 101632f -100816: cmpb $8,%dl - jl 100408f + jg 100816f + + cmpb $4,%dl + jg 100408f + + cmpb $2,%dl + jge 100204f + + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + subl %r8d,%eax +100000: + POP_FRAME_POINTER + ret + + ALIGN_TEXT +100816: movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 @@ -130,9 +147,8 @@ ENTRY(memcmp) jne 10081608f POP_FRAME_POINTER ret + ALIGN_TEXT 100408: - cmpb $4,%dl - jl 100204f movl (%rdi),%r8d movl (%rsi),%r9d cmpl %r8d,%r9d @@ -143,9 +159,8 @@ ENTRY(memcmp) jne 10040804f POP_FRAME_POINTER ret + ALIGN_TEXT 100204: - cmpb $2,%dl - jl 100001f movzwl (%rdi),%r8d movzwl (%rsi),%r9d cmpl %r8d,%r9d @@ -156,16 +171,7 @@ ENTRY(memcmp) jne 1f POP_FRAME_POINTER ret -100001: - cmpb $1,%dl - jl 100000f - movzbl (%rdi),%eax - movzbl (%rsi),%r8d - subl %r8d,%eax -100000: - POP_FRAME_POINTER - ret -ALIGN_TEXT + ALIGN_TEXT 101632: cmpq $32,%rdx ja 103200f @@ -187,7 +193,7 @@ ALIGN_TEXT jne 10163224f POP_FRAME_POINTER ret -ALIGN_TEXT + ALIGN_TEXT 103200: movq (%rdi),%r8 movq 8(%rdi),%r9 @@ -218,7 +224,7 @@ ALIGN_TEXT * * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). */ -ALIGN_TEXT + ALIGN_TEXT 10320016: leaq 16(%rdi),%rdi leaq 16(%rsi),%rsi @@ -230,29 +236,29 @@ ALIGN_TEXT leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10081608: 10163224: leaq -8(%rdi,%rdx),%rdi leaq -8(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163216: leaq -16(%rdi,%rdx),%rdi leaq -16(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163208: leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10040804: leaq -4(%rdi,%rdx),%rdi leaq -4(%rsi,%rdx),%rsi jmp 1f -ALIGN_TEXT + ALIGN_TEXT 80: movl (%rdi),%r8d movl (%rsi),%r9d From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 16:28:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 9FDB1656513; Sat, 26 Jun 2021 16:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBznk4hy1z3CmR; Sat, 26 Jun 2021 16:28:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8593021EDF; Sat, 26 Jun 2021 16:28:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QGSQSq035260; Sat, 26 Jun 2021 16:28:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QGSQ6N035259; Sat, 26 Jun 2021 16:28:26 GMT (envelope-from git) Date: Sat, 26 Jun 2021 16:28:26 GMT Message-Id: <202106261628.15QGSQ6N035259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: bbc76189d5f7 - stable/12 - amd64: fixup MEMMOVE comment (10 -> r10) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bbc76189d5f78e04f4593c0ba97b7846dc32f72e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 16:28:27 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bbc76189d5f78e04f4593c0ba97b7846dc32f72e commit bbc76189d5f78e04f4593c0ba97b7846dc32f72e Author: Mateusz Guzik AuthorDate: 2019-05-12 06:42:17 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-26 15:55:34 +0000 amd64: fixup MEMMOVE comment (10 -> r10) Sponsored by: The FreeBSD Foundation (cherry picked from commit 45372f1a6f7a43d235b083e51c9265574201ad26) --- sys/amd64/amd64/support.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 1a08315c2c46..f12bf5f34f70 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -305,7 +305,7 @@ END(memcmp) * rsi - source * rdx - count * - * The macro possibly clobbers the above and: rcx, r8, r9, 10 + * The macro possibly clobbers the above and: rcx, r8, r9, r10 * It does not clobber rax nor r11. */ .macro MEMMOVE erms overlap begin end From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 16:28:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 DF266656514; Sat, 26 Jun 2021 16:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBznl5TJzz3ChF; Sat, 26 Jun 2021 16:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A21B521EE0; Sat, 26 Jun 2021 16:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QGSRMP035285; Sat, 26 Jun 2021 16:28:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QGSRYR035283; Sat, 26 Jun 2021 16:28:27 GMT (envelope-from git) Date: Sat, 26 Jun 2021 16:28:27 GMT Message-Id: <202106261628.15QGSRYR035283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 8b06406210e0 - stable/12 - amd64: stop re-reading curpc in suword MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8b06406210e0d1dcd222b39316d94715eff8da32 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 16:28:28 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8b06406210e0d1dcd222b39316d94715eff8da32 commit 8b06406210e0d1dcd222b39316d94715eff8da32 Author: Mateusz Guzik AuthorDate: 2019-05-12 06:34:58 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-26 15:56:56 +0000 amd64: stop re-reading curpc in suword Plugs re-reads missed in r341719 Sponsored by: The FreeBSD Foundation (cherry picked from commit 8eae2be460aebfcba63cf5cdc11fa6fd0962470e) --- sys/amd64/amd64/support.S | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index f12bf5f34f70..c78055386def 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -1190,7 +1190,6 @@ ENTRY(suword_nosmap) movq %rsi,(%rdi) xorl %eax,%eax - movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret @@ -1209,7 +1208,6 @@ ENTRY(suword_smap) movq %rsi,(%rdi) clac xorl %eax,%eax - movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret @@ -1226,7 +1224,6 @@ ENTRY(suword32_nosmap) movl %esi,(%rdi) xorl %eax,%eax - movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret @@ -1245,7 +1242,6 @@ ENTRY(suword32_smap) movl %esi,(%rdi) clac xorl %eax,%eax - movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 16:28:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 A1EC6656056; Sat, 26 Jun 2021 16:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBznn1MMFz3Ck4; Sat, 26 Jun 2021 16:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD34922010; Sat, 26 Jun 2021 16:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QGSSRT035314; Sat, 26 Jun 2021 16:28:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QGSSZj035313; Sat, 26 Jun 2021 16:28:28 GMT (envelope-from git) Date: Sat, 26 Jun 2021 16:28:28 GMT Message-Id: <202106261628.15QGSSZj035313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2b07b66a4d44 - stable/12 - amd64: typo fix: memcmpy -> memcmp in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2b07b66a4d44051babbd77eaffcc39404334d219 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 16:28:29 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2b07b66a4d44051babbd77eaffcc39404334d219 commit 2b07b66a4d44051babbd77eaffcc39404334d219 Author: Mateusz Guzik AuthorDate: 2021-06-26 03:57:47 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-26 16:27:39 +0000 amd64: typo fix: memcmpy -> memcmp in a comment Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 9a8e4527f07dbb356bb1942efc09888f957df056) --- sys/amd64/amd64/support.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index c78055386def..f2bc07701f3c 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -106,7 +106,7 @@ ENTRY(sse2_pagezero) END(sse2_pagezero) /* - * memcmpy(b1, b2, len) + * memcmp(b1, b2, len) * rdi,rsi,rdx */ ENTRY(memcmp) From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 22:43:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 5476465AD11; Sat, 26 Jun 2021 22:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC86q1nKQz3tC0; Sat, 26 Jun 2021 22:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25C2B26DCF; Sat, 26 Jun 2021 22:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QMhlkZ041131; Sat, 26 Jun 2021 22:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QMhlMu041130; Sat, 26 Jun 2021 22:43:47 GMT (envelope-from git) Date: Sat, 26 Jun 2021 22:43:47 GMT Message-Id: <202106262243.15QMhlMu041130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 3747e3b28ee6 - stable/13 - nfsd: Add support for the NFSv4.1/4.2 Secinfo_no_name operation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3747e3b28ee6639c1ed7e83dc53e07dcf794fbc9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 22:43:47 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3747e3b28ee6639c1ed7e83dc53e07dcf794fbc9 commit 3747e3b28ee6639c1ed7e83dc53e07dcf794fbc9 Author: Rick Macklem AuthorDate: 2021-05-31 00:52:43 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 22:40:07 +0000 nfsd: Add support for the NFSv4.1/4.2 Secinfo_no_name operation The Linux client is now attempting to use the Secinfo_no_name operation for NFSv4.1/4.2 mounts. Although it does not seem to mind the NFSERR_NOTSUPP reply, adding support for it seems reasonable. I also noticed that "savflag" needed to be 64bits in nfsrvd_secinfo() since nd_flag in now 64bits, so I changed the declaration of it there. I also added code to set "vp" NULL after performing Secinfo/Secinfo_no_name, since these operations consume the current FH, which is represented by "vp" in nfsrvd_compound(). Fixing when the server replies NFSERR_WRONGSEC so that it conforms to RFC5661 Sec. 2.6 still needs to be done in a future commit. (cherry picked from commit 947bd2479ba9661a99f2415038e7b5fa972ec843) --- sys/fs/nfs/nfs_commonsubs.c | 2 +- sys/fs/nfs/nfs_var.h | 2 + sys/fs/nfs/nfsproto.h | 4 ++ sys/fs/nfsserver/nfs_nfsdserv.c | 113 +++++++++++++++++++++++++++++++++++++- sys/fs/nfsserver/nfs_nfsdsocket.c | 15 ++++- sys/fs/nfsserver/nfs_nfsdsubs.c | 3 +- 6 files changed, 134 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 7ddef0f19ddc..02416da54f01 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -168,7 +168,7 @@ struct nfsv4_opflag nfsv4_opflag[NFSV42_NOPS] = { { 0, 1, 0, 1, LK_EXCLUSIVE, 1, 1 }, /* Layout Commit */ { 0, 1, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Layout Get */ { 0, 1, 0, 1, LK_EXCLUSIVE, 1, 0 }, /* Layout Return */ - { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Secinfo No name */ + { 0, 1, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Secinfo No name */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Sequence */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Set SSV */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Test StateID */ diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index f23d56050449..c1ca7c03af39 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -232,6 +232,8 @@ int nfsrvd_renew(struct nfsrv_descript *, int, vnode_t, struct nfsexstuff *); int nfsrvd_secinfo(struct nfsrv_descript *, int, vnode_t, struct nfsexstuff *); +int nfsrvd_secinfononame(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); int nfsrvd_setclientid(struct nfsrv_descript *, int, vnode_t, struct nfsexstuff *); int nfsrvd_setclientidcfrm(struct nfsrv_descript *, int, diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index a1a992d14cdb..62d86c3a4593 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -726,6 +726,10 @@ #define NFSCDFS4_BACK 0x2 #define NFSCDFS4_BOTH 0x3 +/* Enum values for Secinfo_no_name. */ +#define NFSSECINFONONAME_CURFH 0 +#define NFSSECINFONONAME_PARENT 1 + #if defined(_KERNEL) || defined(KERNEL) /* Conversion macros */ #define vtonfsv2_mode(t,m) \ diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index ef78f90fabfc..5d3c6f65ced0 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -3664,7 +3664,8 @@ nfsrvd_secinfo(struct nfsrv_descript *nd, int isdgram, struct nfsrvfh fh; struct nfsexstuff retnes; u_int32_t *sizp; - int error = 0, savflag, i; + int error = 0, i; + uint64_t savflag; char *bufp; u_long *hashp; struct thread *p = curthread; @@ -3754,6 +3755,116 @@ out: return (error); } +/* + * nfsv4 security info no name service + */ +int +nfsrvd_secinfononame(struct nfsrv_descript *nd, int isdgram, + vnode_t dp, struct nfsexstuff *exp) +{ + uint32_t *tl, *sizp; + struct nameidata named; + vnode_t dirp = NULL, vp; + struct nfsrvfh fh; + struct nfsexstuff retnes; + int error = 0, fhstyle, i, len; + uint64_t savflag; + char *bufp; + u_long *hashp; + struct thread *p = curthread; + + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + fhstyle = fxdr_unsigned(int, *tl); + switch (fhstyle) { + case NFSSECINFONONAME_PARENT: + NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, LOOKUP, + LOCKLEAF | SAVESTART); + nfsvno_setpathbuf(&named, &bufp, &hashp); + error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); + if (error != 0) { + vput(dp); + nfsvno_relpathbuf(&named); + goto nfsmout; + } + if (nd->nd_repstat == 0) + nd->nd_repstat = nfsvno_namei(nd, &named, dp, 1, exp, p, &dirp); + else + vput(dp); + if (dirp != NULL) + vrele(dirp); + vrele(named.ni_startdir); + nfsvno_relpathbuf(&named); + vp = named.ni_vp; + break; + case NFSSECINFONONAME_CURFH: + vp = dp; + break; + default: + nd->nd_repstat = NFSERR_INVAL; + vput(dp); + } + if (nd->nd_repstat != 0) + goto nfsmout; + fh.nfsrvfh_len = NFSX_MYFH; + nd->nd_repstat = nfsvno_getfh(vp, (fhandle_t *)fh.nfsrvfh_data, p); + vput(vp); + savflag = nd->nd_flag; + if (nd->nd_repstat == 0) { + nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, NULL, 0); + if (vp != NULL) + vput(vp); + } + nd->nd_flag = savflag; + if (nd->nd_repstat != 0) + goto nfsmout; + + /* + * Finally have the export flags for fh/parent, so we can create + * the security info. + */ + len = 0; + NFSM_BUILD(sizp, uint32_t *, NFSX_UNSIGNED); + for (i = 0; i < retnes.nes_numsecflavor; i++) { + if (retnes.nes_secflavors[i] == AUTH_SYS) { + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(RPCAUTH_UNIX); + len++; + } else if (retnes.nes_secflavors[i] == RPCSEC_GSS_KRB5) { + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(RPCAUTH_GSS); + nfsm_strtom(nd, nfsgss_mechlist[KERBV_MECH].str, + nfsgss_mechlist[KERBV_MECH].len); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(GSS_KERBV_QOP); + *tl = txdr_unsigned(RPCAUTHGSS_SVCNONE); + len++; + } else if (retnes.nes_secflavors[i] == RPCSEC_GSS_KRB5I) { + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(RPCAUTH_GSS); + nfsm_strtom(nd, nfsgss_mechlist[KERBV_MECH].str, + nfsgss_mechlist[KERBV_MECH].len); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(GSS_KERBV_QOP); + *tl = txdr_unsigned(RPCAUTHGSS_SVCINTEGRITY); + len++; + } else if (retnes.nes_secflavors[i] == RPCSEC_GSS_KRB5P) { + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(RPCAUTH_GSS); + nfsm_strtom(nd, nfsgss_mechlist[KERBV_MECH].str, + nfsgss_mechlist[KERBV_MECH].len); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(GSS_KERBV_QOP); + *tl = txdr_unsigned(RPCAUTHGSS_SVCPRIVACY); + len++; + } + } + *sizp = txdr_unsigned(len); + +nfsmout: + NFSEXITCODE2(error, nd); + return (error); +} + /* * nfsv4 set client id service */ diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index e9602c352420..a8e1757835ac 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -188,7 +188,7 @@ int (*nfsrv4_ops0[NFSV42_NOPS])(struct nfsrv_descript *, nfsrvd_layoutcommit, nfsrvd_layoutget, nfsrvd_layoutreturn, - nfsrvd_notsupp, + nfsrvd_secinfononame, nfsrvd_sequence, nfsrvd_notsupp, nfsrvd_teststateid, @@ -1175,9 +1175,20 @@ tryagain: } break; } - if (nd->nd_repstat == 0) + if (nd->nd_repstat == 0) { error = (*(nfsrv4_ops0[op]))(nd, isdgram, vp, &vpnes); + if ((op == NFSV4OP_SECINFO || + op == NFSV4OP_SECINFONONAME) && + error == 0 && nd->nd_repstat == 0) { + /* + * Secinfo and Secinfo_no_name + * consume the current FH. + */ + vrele(vp); + vp = NULL; + } + } if (nfsv4_opflag[op].modifyfs) vn_finished_write(temp_mp); } else { diff --git a/sys/fs/nfsserver/nfs_nfsdsubs.c b/sys/fs/nfsserver/nfs_nfsdsubs.c index d407dad8367d..8c7db36bbd05 100644 --- a/sys/fs/nfsserver/nfs_nfsdsubs.c +++ b/sys/fs/nfsserver/nfs_nfsdsubs.c @@ -1890,7 +1890,8 @@ nfsrv_parsename(struct nfsrv_descript *nd, char *bufp, u_long *hashp, * For V4, check for lookup parent. * Otherwise, get the component name. */ - if ((nd->nd_flag & ND_NFSV4) && nd->nd_procnum == NFSV4OP_LOOKUPP) { + if ((nd->nd_flag & ND_NFSV4) && (nd->nd_procnum == NFSV4OP_LOOKUPP || + nd->nd_procnum == NFSV4OP_SECINFONONAME)) { *tocp++ = '.'; hash += ((u_char)'.'); *tocp++ = '.'; From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 22:46:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 A5B8E65AE60; Sat, 26 Jun 2021 22:46:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC8BV4LRhz3tHC; Sat, 26 Jun 2021 22:46:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CF0E26F47; Sat, 26 Jun 2021 22:46:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QMkwhP041547; Sat, 26 Jun 2021 22:46:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QMkwf8041546; Sat, 26 Jun 2021 22:46:58 GMT (envelope-from git) Date: Sat, 26 Jun 2021 22:46:58 GMT Message-Id: <202106262246.15QMkwf8041546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 0da79992428f - stable/13 - nfsd: Delete extraneous NFSv4 root checks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0da79992428fb154cacfb58ca230bfdec8895958 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 22:46:58 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0da79992428fb154cacfb58ca230bfdec8895958 commit 0da79992428fb154cacfb58ca230bfdec8895958 Author: Rick Macklem AuthorDate: 2021-06-01 02:41:17 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 22:43:49 +0000 nfsd: Delete extraneous NFSv4 root checks There are several NFSv4.1/4.2 server operation functions which have unneeded checks for the NFSv4 root being set up. The checks are not needed because the operations always follow a Sequence operation, which performs the check. This patch deletes these checks, simplifying the code so that a future patch that fixes the checks to conform with RFC5661 Sec. 2.6 will be less extension. (cherry picked from commit 1d4afcaca282f4ba249d8508f4149d9c0b058492) --- sys/fs/nfsserver/nfs_nfsdserv.c | 68 ----------------------------------------- 1 file changed, 68 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 5d3c6f65ced0..329c096c7570 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -4523,10 +4523,6 @@ nfsrvd_reclaimcomplete(struct nfsrv_descript *nd, __unused int isdgram, uint32_t *tl; int error = 0, onefs; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); /* * I believe that a ReclaimComplete with rca_one_fs == TRUE is only @@ -4644,10 +4640,6 @@ nfsrvd_freestateid(struct nfsrv_descript *nd, __unused int isdgram, int error = 0; struct thread *p = curthread; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_STATEID); stateid.seqid = fxdr_unsigned(uint32_t, *tl++); NFSBCOPY(tl, stateid.other, NFSX_STATEIDOTHER); @@ -4694,10 +4686,6 @@ nfsrvd_layoutget(struct nfsrv_descript *nd, __unused int isdgram, char *layp; struct thread *p = curthread; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, 4 * NFSX_UNSIGNED + 3 * NFSX_HYPER + NFSX_STATEID); tl++; /* Signal layout available. Ignore for now. */ @@ -4795,10 +4783,6 @@ nfsrvd_layoutcommit(struct nfsrv_descript *nd, __unused int isdgram, struct thread *p = curthread; layp = NULL; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED + 2 * NFSX_HYPER + NFSX_STATEID); offset = fxdr_hyper(tl); tl += 2; @@ -4878,10 +4862,6 @@ nfsrvd_layoutreturn(struct nfsrv_descript *nd, __unused int isdgram, struct thread *p = curthread; layp = NULL; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, 4 * NFSX_UNSIGNED); reclaim = *tl++; layouttype = fxdr_unsigned(int, *tl++); @@ -4964,10 +4944,6 @@ nfsrvd_layouterror(struct nfsrv_descript *nd, __unused int isdgram, char devid[NFSX_V4DEVICEID]; uint64_t offset, len; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + NFSX_UNSIGNED); offset = fxdr_hyper(tl); tl += 2; @@ -5032,10 +5008,6 @@ nfsrvd_layoutstats(struct nfsrv_descript *nd, __unused int isdgram, uint64_t offset, len, readcount, readbytes, writecount, writebytes __unused; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, 6 * NFSX_HYPER + NFSX_STATEID + NFSX_V4DEVICEID + 2 * NFSX_UNSIGNED); offset = fxdr_hyper(tl); tl += 2; @@ -5092,10 +5064,6 @@ nfsrvd_ioadvise(struct nfsrv_descript *nd, __unused int isdgram, int error = 0, ret; off_t offset, len; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_STATEID + 2 * NFSX_HYPER); stateid.seqid = fxdr_unsigned(uint32_t, *tl++); NFSBCOPY(tl, stateid.other, NFSX_STATEIDOTHER); @@ -5185,10 +5153,6 @@ nfsrvd_getdevinfo(struct nfsrv_descript *nd, __unused int isdgram, char devid[NFSX_V4DEVICEID], *devaddr; time_t dev_time; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, 3 * NFSX_UNSIGNED + NFSX_V4DEVICEID); NFSBCOPY(tl, devid, NFSX_V4DEVICEID); tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); @@ -5257,10 +5221,6 @@ nfsrvd_teststateid(struct nfsrv_descript *nd, __unused int isdgram, int cnt, error = 0, i, ret; struct thread *p = curthread; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); cnt = fxdr_unsigned(int, *tl); if (cnt <= 0 || cnt > 1024) { @@ -5307,10 +5267,6 @@ nfsrvd_allocate(struct nfsrv_descript *nd, __unused int isdgram, nfsquad_t clientid; nfsattrbit_t attrbits; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } gotproxystateid = 0; NFSM_DISSECT(tl, uint32_t *, NFSX_STATEID + 2 * NFSX_HYPER); stp->ls_flags = (NFSLCK_CHECK | NFSLCK_WRITEACCESS); @@ -5404,10 +5360,6 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __unused int isdgram, void *rl_rcookie, *rl_wcookie; rl_rcookie = rl_wcookie = NULL; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } if (nfsrv_devidcnt > 0) { /* * For a pNFS server, reply NFSERR_NOTSUPP so that the client @@ -5634,10 +5586,6 @@ nfsrvd_seek(struct nfsrv_descript *nd, __unused int isdgram, nfsattrbit_t attrbits; bool eof; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_STATEID + NFSX_HYPER + NFSX_UNSIGNED); /* Ignore the stateid for now. */ tl += (NFSX_STATEID / NFSX_UNSIGNED); @@ -5707,10 +5655,6 @@ nfsrvd_getxattr(struct nfsrv_descript *nd, __unused int isdgram, uint16_t off; error = 0; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); len = fxdr_unsigned(int, *tl); if (len <= 0) { @@ -5779,10 +5723,6 @@ nfsrvd_setxattr(struct nfsrv_descript *nd, __unused int isdgram, error = 0; name = NULL; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); opt = fxdr_unsigned(int, *tl++); len = fxdr_unsigned(int, *tl); @@ -5872,10 +5812,6 @@ nfsrvd_rmxattr(struct nfsrv_descript *nd, __unused int isdgram, error = 0; name = NULL; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); len = fxdr_unsigned(int, *tl); if (len <= 0) { @@ -5942,10 +5878,6 @@ nfsrvd_listxattr(struct nfsrv_descript *nd, __unused int isdgram, error = 0; buf = NULL; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; - goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_HYPER + NFSX_UNSIGNED); /* * The cookie doesn't need to be in net byte order, but FreeBSD From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 22:50:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 BD72A65B129; Sat, 26 Jun 2021 22:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC8GR4g59z3tDc; Sat, 26 Jun 2021 22:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8838226F4A; Sat, 26 Jun 2021 22:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QMoNOx050077; Sat, 26 Jun 2021 22:50:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QMoN1J050076; Sat, 26 Jun 2021 22:50:23 GMT (envelope-from git) Date: Sat, 26 Jun 2021 22:50:23 GMT Message-Id: <202106262250.15QMoN1J050076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 92500ec0c45c - stable/13 - nfsd: Fix the failure return for non-fh NFSv4 operations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 92500ec0c45cbef90634fb9987287ac2768ab475 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 22:50:23 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=92500ec0c45cbef90634fb9987287ac2768ab475 commit 92500ec0c45cbef90634fb9987287ac2768ab475 Author: Rick Macklem AuthorDate: 2021-06-02 22:28:07 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 22:46:18 +0000 nfsd: Fix the failure return for non-fh NFSv4 operations Without this patch, nfsd_checkrootexp() returns failure and then the NFSv4 operation would reply NFSERR_WRONGSEC. RFC5661 Sec. 2.6 only allows a few NFSv4 operations, none of which call nfsv4_checktootexp(), to return NFSERR_WRONGSEC. This patch modifies nfsd_checkrootexp() to return the error instead of a boolean and sets the returned error to an RPC layer AUTH_ERR, as discussed on nfsv4@ietf.org. The patch also fixes nfsd_errmap() so that the pseudo error NFSERR_AUTHERR is handled correctly such that an RPC layer AUTH_ERR is replied to the NFSv4 client. The two new "enum auth_stat" values have not yet been assigned by IANA, but are the expected next two values. The effect on extant NFSv4 clients of this change appears limited to reporting a different failure error when a mount that does not use adequate security is attempted. (cherry picked from commit 984c71f90300906e106b9714af0e7d9b542c50e6) --- sys/fs/nfsserver/nfs_nfsdserv.c | 45 ++++++++++------------------------------- sys/fs/nfsserver/nfs_nfsdsubs.c | 11 ++++++++-- sys/rpc/auth.h | 5 +++++ 3 files changed, 25 insertions(+), 36 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 329c096c7570..f4d6dbe42a21 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); extern u_int32_t newnfs_false, newnfs_true; extern enum vtype nv34tov_type[8]; extern struct timeval nfsboottime; -extern int nfs_rootfhset; extern int nfsrv_enable_crossmntpt; extern int nfsrv_statehashsize; extern int nfsrv_layouthashsize; @@ -3360,10 +3359,8 @@ nfsrvd_delegpurge(struct nfsrv_descript *nd, __unused int isdgram, nfsquad_t clientid; struct thread *p = curthread; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); clientid.lval[0] = *tl++; clientid.lval[1] = *tl; @@ -3625,10 +3622,8 @@ nfsrvd_renew(struct nfsrv_descript *nd, __unused int isdgram, nd->nd_repstat = NFSERR_NOTSUPP; goto nfsmout; } - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } NFSM_DISSECT(tl, u_int32_t *, NFSX_HYPER); clientid.lval[0] = *tl++; clientid.lval[1] = *tl; @@ -3893,10 +3888,8 @@ nfsrvd_setclientid(struct nfsrv_descript *nd, __unused int isdgram, nd->nd_repstat = NFSERR_NOTSUPP; goto nfsmout; } - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto out; - } NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF + NFSX_UNSIGNED); verf = (u_char *)tl; tl += (NFSX_VERF / NFSX_UNSIGNED); @@ -4048,10 +4041,8 @@ nfsrvd_setclientidcfrm(struct nfsrv_descript *nd, nd->nd_repstat = NFSERR_NOTSUPP; goto nfsmout; } - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_HYPER); clientid.lval[0] = *tl++; clientid.lval[1] = *tl++; @@ -4146,10 +4137,8 @@ nfsrvd_releaselckown(struct nfsrv_descript *nd, __unused int isdgram, nd->nd_repstat = NFSERR_NOTSUPP; goto nfsmout; } - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); len = fxdr_unsigned(int, *(tl + 2)); if (len <= 0 || len > NFSV4_OPAQUELIMIT) { @@ -4213,10 +4202,8 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused int isdgram, #endif struct thread *p = curthread; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF + NFSX_UNSIGNED); verf = (uint8_t *)tl; tl += (NFSX_VERF / NFSX_UNSIGNED); @@ -4370,10 +4357,8 @@ nfsrvd_createsession(struct nfsrv_descript *nd, __unused int isdgram, uint32_t rdmacnt; struct thread *p = curthread; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } sep = (struct nfsdsession *)malloc(sizeof(struct nfsdsession), M_NFSDSESSION, M_WAITOK | M_ZERO); sep->sess_refcnt = 1; @@ -4481,10 +4466,8 @@ nfsrvd_sequence(struct nfsrv_descript *nd, __unused int isdgram, int cache_this, error = 0; struct thread *p = curthread; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID); NFSBCOPY(tl, nd->nd_sessionid, NFSX_V4SESSIONID); NFSM_DISSECT(tl, uint32_t *, 4 * NFSX_UNSIGNED); @@ -4554,10 +4537,8 @@ nfsrvd_destroyclientid(struct nfsrv_descript *nd, __unused int isdgram, int error = 0; struct thread *p = curthread; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); clientid.lval[0] = *tl++; clientid.lval[1] = *tl; @@ -4578,10 +4559,8 @@ nfsrvd_bindconnsess(struct nfsrv_descript *nd, __unused int isdgram, uint8_t sessid[NFSX_V4SESSIONID]; int error = 0, foreaft; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); NFSBCOPY(tl, sessid, NFSX_V4SESSIONID); tl += (NFSX_V4SESSIONID / NFSX_UNSIGNED); @@ -4616,10 +4595,8 @@ nfsrvd_destroysession(struct nfsrv_descript *nd, __unused int isdgram, uint8_t *cp, sessid[NFSX_V4SESSIONID]; int error = 0; - if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { - nd->nd_repstat = NFSERR_WRONGSEC; + if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; - } NFSM_DISSECT(cp, uint8_t *, NFSX_V4SESSIONID); NFSBCOPY(cp, sessid, NFSX_V4SESSIONID); nd->nd_repstat = nfsrv_destroysession(nd, sessid); diff --git a/sys/fs/nfsserver/nfs_nfsdsubs.c b/sys/fs/nfsserver/nfs_nfsdsubs.c index 8c7db36bbd05..8c3e748a290f 100644 --- a/sys/fs/nfsserver/nfs_nfsdsubs.c +++ b/sys/fs/nfsserver/nfs_nfsdsubs.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include extern u_int32_t newnfs_true, newnfs_false; +extern int nfs_rootfhset; extern int nfs_pubfhset; extern struct nfsclienthashhead *nfsclienthash; extern int nfsrv_clienthashsize; @@ -1543,6 +1544,8 @@ nfsd_errmap(struct nfsrv_descript *nd) if (!nd->nd_repstat) return (0); + if ((nd->nd_repstat & NFSERR_AUTHERR) != 0) + return (txdr_unsigned(NFSERR_ACCES)); if (nd->nd_flag & (ND_NFSV3 | ND_NFSV4)) { if (nd->nd_procnum == NFSPROC_NOOP) return (txdr_unsigned(nd->nd_repstat & 0xffff)); @@ -2116,6 +2119,8 @@ int nfsd_checkrootexp(struct nfsrv_descript *nd) { + if (nfs_rootfhset == 0) + return (NFSERR_AUTHERR | AUTH_FAILED); if ((nd->nd_flag & (ND_GSS | ND_EXAUTHSYS)) == ND_EXAUTHSYS) goto checktls; if ((nd->nd_flag & (ND_GSSINTEGRITY | ND_EXGSSINTEGRITY)) == @@ -2127,7 +2132,7 @@ nfsd_checkrootexp(struct nfsrv_descript *nd) if ((nd->nd_flag & (ND_GSS | ND_GSSINTEGRITY | ND_GSSPRIVACY | ND_EXGSS)) == (ND_GSS | ND_EXGSS)) goto checktls; - return (1); + return (NFSERR_AUTHERR | AUTH_TOOWEAK); checktls: if ((nd->nd_flag & ND_EXTLS) == 0) return (0); @@ -2140,7 +2145,9 @@ checktls: if ((nd->nd_flag & (ND_TLS | ND_EXTLSCERTUSER | ND_EXTLSCERT)) == ND_TLS) return (0); - return (1); + if ((nd->nd_flag & ND_TLS) == 0) + return (NFSERR_AUTHERR | AUTH_NEEDS_TLS); + return (NFSERR_AUTHERR | AUTH_NEEDS_TLS_MUTUAL_HOST); } /* diff --git a/sys/rpc/auth.h b/sys/rpc/auth.h index a426a34c3747..fd56b33da52e 100644 --- a/sys/rpc/auth.h +++ b/sys/rpc/auth.h @@ -150,6 +150,11 @@ enum auth_stat { */ RPCSEC_GSS_CREDPROBLEM = 13, RPCSEC_GSS_CTXPROBLEM = 14, + /* + * RPC-over-TLS errors + */ + AUTH_NEEDS_TLS = 15, + AUTH_NEEDS_TLS_MUTUAL_HOST = 16, /* Also used by RPCSEC_TLS for the same purpose */ RPCSEC_GSS_NODISPATCH = 0x8000000 }; From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 22:53:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 9424465B38E; Sat, 26 Jun 2021 22:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC8Kz3nDWz3tj1; Sat, 26 Jun 2021 22:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A0E82706C; Sat, 26 Jun 2021 22:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QMrRJS054981; Sat, 26 Jun 2021 22:53:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QMrRPq054980; Sat, 26 Jun 2021 22:53:27 GMT (envelope-from git) Date: Sat, 26 Jun 2021 22:53:27 GMT Message-Id: <202106262253.15QMrRPq054980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 54ccbc9bb6c5 - stable/13 - nfsd: Pre-parse the next NFSv4 operation number for put FH operations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 54ccbc9bb6c5a5077e8cda21902a6e9dc188c6cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 22:53:27 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=54ccbc9bb6c5a5077e8cda21902a6e9dc188c6cf commit 54ccbc9bb6c5a5077e8cda21902a6e9dc188c6cf Author: Rick Macklem AuthorDate: 2021-06-04 03:48:26 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 22:50:16 +0000 nfsd: Pre-parse the next NFSv4 operation number for put FH operations RFC5661 Sec. 2.6 specifies when a NFSERR_WRONGSEC error reply can be done. For the four operations PutFH, PutrootFH, PutpublicFH and RestoreFH, NFSERR_WRONGSEC can or cannot be replied, depending upon what operation follows one of these operations in the compound. This patch modifies nfsrvd_compound() so that it parses the next operation number before executing any of the above four operations, storing it in "nextop". A future commit will implement use of "nextop" to decide if NFSERR_WRONGSEC can be replied for the above four operations. This commit should not change the semantics of performing the compound RPC. (cherry picked from commit d224f05fcfc13725c43ea0a02d511b3bf6a8ad14) --- sys/fs/nfsserver/nfs_nfsdsocket.c | 109 ++++++++++++++++++++++++++++++++++---- 1 file changed, 100 insertions(+), 9 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index a8e1757835ac..f40569da0097 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -705,7 +705,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, int i, lktype, op, op0 = 0, statsinprog = 0; u_int32_t *tl; struct nfsclient *clp, *nclp; - int numops, error = 0, igotlock; + int error = 0, igotlock, nextop, numops, savefhcnt; u_int32_t retops = 0, *retopsp = NULL, *repp; vnode_t vp, nvp, savevp; struct nfsrvfh fh; @@ -822,6 +822,8 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, savevp = vp = NULL; save_fsid.val[0] = save_fsid.val[1] = 0; cur_fsid.val[0] = cur_fsid.val[1] = 0; + nextop = -1; + savefhcnt = 0; /* If taglen < 0, there was a parsing error in nfsd_getminorvers(). */ if (taglen < 0) { @@ -850,10 +852,20 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, * savevpnes and vpnes - are the export flags for the above. */ for (i = 0; i < numops; i++) { - NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); NFSM_BUILD(repp, u_int32_t *, 2 * NFSX_UNSIGNED); - *repp = *tl; - op = fxdr_unsigned(int, *tl); + if (savefhcnt > 0) { + op = NFSV4OP_SAVEFH; + *repp = txdr_unsigned(op); + savefhcnt--; + } else if (nextop == -1) { + NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); + *repp = *tl; + op = fxdr_unsigned(int, *tl); + } else { + op = nextop; + *repp = txdr_unsigned(op); + nextop = -1; + } NFSD_DEBUG(4, "op=%d\n", op); if (op < NFSV4OP_ACCESS || op >= NFSV42_NOPS || (op >= NFSV4OP_NOPS && (nd->nd_flag & ND_NFSV41) == 0) || @@ -950,6 +962,25 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, error = nfsrv_mtofh(nd, &fh); if (error) goto nfsmout; + if ((nd->nd_flag & ND_LASTOP) == 0) { + /* + * Pre-parse the next op#. If it is + * SaveFH, count it and skip to the + * next op#, if not the last op#. + * nextop is used to determine if + * NFSERR_WRONGSEC can be returned, + * per RFC5661 Sec. 2.6. + */ + do { + NFSM_DISSECT(tl, uint32_t *, + NFSX_UNSIGNED); + nextop = fxdr_unsigned(int, *tl); + if (nextop == NFSV4OP_SAVEFH && + i < numops - 1) + savefhcnt++; + } while (nextop == NFSV4OP_SAVEFH && + i < numops - 1); + } if (!nd->nd_repstat) nfsd_fhtovp(nd, &fh, LK_SHARED, &nvp, &nes, NULL, 0); @@ -964,11 +995,31 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, } break; case NFSV4OP_PUTPUBFH: - if (nfs_pubfhset) - nfsd_fhtovp(nd, &nfs_pubfh, LK_SHARED, &nvp, - &nes, NULL, 0); - else - nd->nd_repstat = NFSERR_NOFILEHANDLE; + if (nfs_pubfhset) { + if ((nd->nd_flag & ND_LASTOP) == 0) { + /* + * Pre-parse the next op#. If it is + * SaveFH, count it and skip to the + * next op#, if not the last op#. + * nextop is used to determine if + * NFSERR_WRONGSEC can be returned, + * per RFC5661 Sec. 2.6. + */ + do { + NFSM_DISSECT(tl, uint32_t *, + NFSX_UNSIGNED); + nextop = fxdr_unsigned(int, + *tl); + if (nextop == NFSV4OP_SAVEFH && + i < numops - 1) + savefhcnt++; + } while (nextop == NFSV4OP_SAVEFH && + i < numops - 1); + } + nfsd_fhtovp(nd, &nfs_pubfh, LK_SHARED, &nvp, + &nes, NULL, 0); + } else + nd->nd_repstat = NFSERR_NOFILEHANDLE; if (!nd->nd_repstat) { if (vp) vrele(vp); @@ -980,6 +1031,26 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, break; case NFSV4OP_PUTROOTFH: if (nfs_rootfhset) { + if ((nd->nd_flag & ND_LASTOP) == 0) { + /* + * Pre-parse the next op#. If it is + * SaveFH, count it and skip to the + * next op#, if not the last op#. + * nextop is used to determine if + * NFSERR_WRONGSEC can be returned, + * per RFC5661 Sec. 2.6. + */ + do { + NFSM_DISSECT(tl, uint32_t *, + NFSX_UNSIGNED); + nextop = fxdr_unsigned(int, + *tl); + if (nextop == NFSV4OP_SAVEFH && + i < numops - 1) + savefhcnt++; + } while (nextop == NFSV4OP_SAVEFH && + i < numops - 1); + } nfsd_fhtovp(nd, &nfs_rootfh, LK_SHARED, &nvp, &nes, NULL, 0); if (!nd->nd_repstat) { @@ -1016,6 +1087,26 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, break; case NFSV4OP_RESTOREFH: if (savevp) { + if ((nd->nd_flag & ND_LASTOP) == 0) { + /* + * Pre-parse the next op#. If it is + * SaveFH, count it and skip to the + * next op#, if not the last op#. + * nextop is used to determine if + * NFSERR_WRONGSEC can be returned, + * per RFC5661 Sec. 2.6. + */ + do { + NFSM_DISSECT(tl, uint32_t *, + NFSX_UNSIGNED); + nextop = fxdr_unsigned(int, + *tl); + if (nextop == NFSV4OP_SAVEFH && + i < numops - 1) + savefhcnt++; + } while (nextop == NFSV4OP_SAVEFH && + i < numops - 1); + } nd->nd_repstat = 0; /* If vp == savevp, a no-op */ if (vp != savevp) { From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 22:56:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 B7D3B65B39E; Sat, 26 Jun 2021 22:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC8Pm4mytz3tlY; Sat, 26 Jun 2021 22:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BDE02721D; Sat, 26 Jun 2021 22:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QMuiRD055319; Sat, 26 Jun 2021 22:56:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QMui3G055318; Sat, 26 Jun 2021 22:56:44 GMT (envelope-from git) Date: Sat, 26 Jun 2021 22:56:44 GMT Message-Id: <202106262256.15QMui3G055318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 9f581cbd5aac - stable/13 - nfsd: Fix when NFSERR_WRONGSEC may be replied to NFSv4 clients MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9f581cbd5aac096b3b08f343b9019c0f2432083a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 22:56:44 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9f581cbd5aac096b3b08f343b9019c0f2432083a commit 9f581cbd5aac096b3b08f343b9019c0f2432083a Author: Rick Macklem AuthorDate: 2021-06-05 23:53:07 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 22:52:30 +0000 nfsd: Fix when NFSERR_WRONGSEC may be replied to NFSv4 clients Commit d224f05fcfc1 pre-parsed the next operation number for the put file handle operations. This patch uses this next operation number, plus the type of the file handle being set by the put file handle operation, to implement the rules in RFC5661 Sec. 2.6 with respect to replying NFSERR_WRONGSEC. This patch also adds a check to see if NFSERR_WRONGSEC should be replied when about to perform Lookup, Lookupp or Open with a file name component, so that the NFSERR_WRONGSEC reply is done for these operations, as required by RFC5661 Sec. 2.6. This patch does not have any practical effect for the FreeBSD NFSv4 client and I believe that the same is true for the Linux client, since NFSERR_WRONGSEC is considered a fatal error at this time. (cherry picked from commit a5df139ec614c34f505bce9de3447fe7b49016e6) --- sys/fs/nfs/nfs_var.h | 6 ++- sys/fs/nfsserver/nfs_nfsdport.c | 91 ++++++++++++++++++++++++++------------- sys/fs/nfsserver/nfs_nfsdserv.c | 19 ++++++-- sys/fs/nfsserver/nfs_nfsdsocket.c | 53 ++++++++++++++--------- 4 files changed, 114 insertions(+), 55 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index c1ca7c03af39..9db8b92f44e7 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -381,8 +381,9 @@ int nfscl_request(struct nfsrv_descript *, vnode_t, /* nfs_nfsdsubs.c */ void nfsd_fhtovp(struct nfsrv_descript *, struct nfsrvfh *, int, - vnode_t *, struct nfsexstuff *, mount_t *, int); -int nfsd_excred(struct nfsrv_descript *, struct nfsexstuff *, struct ucred *); + vnode_t *, struct nfsexstuff *, mount_t *, int, int); +int nfsd_excred(struct nfsrv_descript *, struct nfsexstuff *, struct ucred *, + bool); int nfsrv_mtofh(struct nfsrv_descript *, struct nfsrvfh *); int nfsrv_putattrbit(struct nfsrv_descript *, nfsattrbit_t *); void nfsrv_wcc(struct nfsrv_descript *, int, struct nfsvattr *, int, @@ -759,6 +760,7 @@ int nfsvno_listxattr(struct vnode *, uint64_t, struct ucred *, struct thread *, u_char **, uint32_t *, bool *); void nfsm_trimtrailing(struct nfsrv_descript *, struct mbuf *, char *, int, int); +bool nfsrv_checkwrongsec(struct nfsrv_descript *, int, enum vtype); /* nfs_commonkrpc.c */ int newnfs_nmcancelreqs(struct nfsmount *); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 4d19c73dfa06..7bcbc738d61b 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3103,9 +3103,9 @@ nfsmout: */ int nfsd_excred(struct nfsrv_descript *nd, struct nfsexstuff *exp, - struct ucred *credanon) + struct ucred *credanon, bool testsec) { - int error = 0; + int error; /* * Check/setup credentials. @@ -3115,18 +3115,12 @@ nfsd_excred(struct nfsrv_descript *nd, struct nfsexstuff *exp, /* * Check to see if the operation is allowed for this security flavor. - * RFC2623 suggests that the NFSv3 Fsinfo RPC be allowed to - * AUTH_NONE or AUTH_SYS for file systems requiring RPCSEC_GSS. - * Also, allow Secinfo, so that it can acquire the correct flavor(s). */ - if (nfsvno_testexp(nd, exp) && - nd->nd_procnum != NFSV4OP_SECINFO && - nd->nd_procnum != NFSPROC_FSINFO) { - if (nd->nd_flag & ND_NFSV4) - error = NFSERR_WRONGSEC; - else - error = (NFSERR_AUTHERR | AUTH_TOOWEAK); - goto out; + error = 0; + if (testsec) { + error = nfsvno_testexp(nd, exp); + if (error != 0) + goto out; } /* @@ -3246,7 +3240,7 @@ nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct sockaddr *nam, void nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, int lktype, struct vnode **vpp, struct nfsexstuff *exp, - struct mount **mpp, int startwrite) + struct mount **mpp, int startwrite, int nextop) { struct mount *mp, *mpw; struct ucred *credanon; @@ -3292,19 +3286,6 @@ nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, int lktype, nd->nd_repstat = EACCES; } - /* - * If TLS is required by the export, check the flags in nd_flag. - */ - if (nd->nd_repstat == 0 && ((NFSVNO_EXTLS(exp) && - (nd->nd_flag & ND_TLS) == 0) || - (NFSVNO_EXTLSCERT(exp) && - (nd->nd_flag & ND_TLSCERT) == 0) || - (NFSVNO_EXTLSCERTUSER(exp) && - (nd->nd_flag & ND_TLSCERTUSER) == 0))) { - vput(*vpp); - nd->nd_repstat = NFSERR_ACCES; - } - /* * Personally, I've never seen any point in requiring a * reserved port#, since only in the rare case where the @@ -3342,7 +3323,8 @@ nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, int lktype, */ if (!nd->nd_repstat) { nd->nd_saveduid = nd->nd_cred->cr_uid; - nd->nd_repstat = nfsd_excred(nd, exp, credanon); + nd->nd_repstat = nfsd_excred(nd, exp, credanon, + nfsrv_checkwrongsec(nd, nextop, (*vpp)->v_type)); if (nd->nd_repstat) vput(*vpp); } @@ -3981,6 +3963,24 @@ nfsvno_testexp(struct nfsrv_descript *nd, struct nfsexstuff *exp) { int i; + /* + * Allow NFSv3 Fsinfo per RFC2623. + */ + if (((nd->nd_flag & ND_NFSV4) != 0 || + nd->nd_procnum != NFSPROC_FSINFO) && + ((NFSVNO_EXTLS(exp) && (nd->nd_flag & ND_TLS) == 0) || + (NFSVNO_EXTLSCERT(exp) && + (nd->nd_flag & ND_TLSCERT) == 0) || + (NFSVNO_EXTLSCERTUSER(exp) && + (nd->nd_flag & ND_TLSCERTUSER) == 0))) { + if ((nd->nd_flag & ND_NFSV4) != 0) + return (NFSERR_WRONGSEC); + else if ((nd->nd_flag & ND_TLS) == 0) + return (NFSERR_AUTHERR | AUTH_NEEDS_TLS); + else + return (NFSERR_AUTHERR | AUTH_NEEDS_TLS_MUTUAL_HOST); + } + /* * This seems odd, but allow the case where the security flavor * list is empty. This happens when NFSv4 is traversing non-exported @@ -4008,7 +4008,9 @@ nfsvno_testexp(struct nfsrv_descript *nd, struct nfsexstuff *exp) (nd->nd_flag & ND_GSS) == 0) return (0); } - return (1); + if ((nd->nd_flag & ND_NFSV4) != 0) + return (NFSERR_WRONGSEC); + return (NFSERR_AUTHERR | AUTH_TOOWEAK); } /* @@ -6616,6 +6618,37 @@ nfsm_trimtrailing(struct nfsrv_descript *nd, struct mbuf *mb, char *bpos, nd->nd_bpos = bpos; } + +/* + * Check to see if a put file handle operation should test for + * NFSERR_WRONGSEC, although NFSv3 actually returns NFSERR_AUTHERR. + * When Open is the next operation, NFSERR_WRONGSEC cannot be + * replied for the Open cases that use a component. Thia can + * be identified by the fact that the file handle's type is VDIR. + */ +bool +nfsrv_checkwrongsec(struct nfsrv_descript *nd, int nextop, enum vtype vtyp) +{ + + if ((nd->nd_flag & ND_NFSV4) == 0) { + if (nd->nd_procnum == NFSPROC_FSINFO) + return (false); + return (true); + } + + if ((nd->nd_flag & ND_LASTOP) != 0) + return (false); + + if (nextop == NFSV4OP_PUTROOTFH || nextop == NFSV4OP_PUTFH || + nextop == NFSV4OP_PUTPUBFH || nextop == NFSV4OP_RESTOREFH || + nextop == NFSV4OP_LOOKUP || nextop == NFSV4OP_LOOKUPP || + nextop == NFSV4OP_SECINFO || nextop == NFSV4OP_SECINFONONAME) + return (false); + if (nextop == NFSV4OP_OPEN && vtyp == VDIR) + return (false); + return (true); +} + extern int (*nfsd_call_nfsd)(struct thread *, struct nfssvc_args *); /* diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index f4d6dbe42a21..adb66d3d794d 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -1669,7 +1669,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, NFSVOPUNLOCK(dp); nd->nd_cred->cr_uid = nd->nd_saveduid; nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, NULL, - 0); /* Locks tdp. */ + 0, -1); /* Locks tdp. */ if (tdp) { tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd, p, 1, NULL); @@ -1800,7 +1800,8 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, /* tovp is always NULL unless NFSv4 */ goto out; } - nfsd_fhtovp(nd, &dfh, LK_EXCLUSIVE, &dp, &tnes, NULL, 0); + nfsd_fhtovp(nd, &dfh, LK_EXCLUSIVE, &dp, &tnes, NULL, + 0, -1); if (dp) NFSVOPUNLOCK(dp); } @@ -3695,7 +3696,12 @@ nfsrvd_secinfo(struct nfsrv_descript *nd, int isdgram, vput(vp); savflag = nd->nd_flag; if (!nd->nd_repstat) { - nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, NULL, 0); + /* + * Pretend the next op is Secinfo, so that no wrongsec + * test will be done. + */ + nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, NULL, 0, + NFSV4OP_SECINFO); if (vp) vput(vp); } @@ -3805,7 +3811,12 @@ nfsrvd_secinfononame(struct nfsrv_descript *nd, int isdgram, vput(vp); savflag = nd->nd_flag; if (nd->nd_repstat == 0) { - nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, NULL, 0); + /* + * Pretend the next op is Secinfo, so that no wrongsec + * test will be done. + */ + nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, NULL, 0, + NFSV4OP_SECINFO); if (vp != NULL) vput(vp); } diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index f40569da0097..85771974be2f 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -584,10 +584,10 @@ tryagain: lktype = LK_EXCLUSIVE; if (nd->nd_flag & ND_PUBLOOKUP) nfsd_fhtovp(nd, &nfs_pubfh, lktype, &vp, &nes, - &mp, nfsrv_writerpc[nd->nd_procnum]); + &mp, nfsrv_writerpc[nd->nd_procnum], -1); else nfsd_fhtovp(nd, &fh, lktype, &vp, &nes, - &mp, nfsrv_writerpc[nd->nd_procnum]); + &mp, nfsrv_writerpc[nd->nd_procnum], -1); if (nd->nd_repstat == NFSERR_PROGNOTV4) goto out; } @@ -702,7 +702,7 @@ static void nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, int taglen, u_int32_t minorvers) { - int i, lktype, op, op0 = 0, statsinprog = 0; + int i, lktype, op, op0 = 0, rstat, statsinprog = 0; u_int32_t *tl; struct nfsclient *clp, *nclp; int error = 0, igotlock, nextop, numops, savefhcnt; @@ -983,7 +983,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, } if (!nd->nd_repstat) nfsd_fhtovp(nd, &fh, LK_SHARED, &nvp, &nes, - NULL, 0); + NULL, 0, nextop); /* For now, allow this for non-export FHs */ if (!nd->nd_repstat) { if (vp) @@ -1017,7 +1017,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, i < numops - 1); } nfsd_fhtovp(nd, &nfs_pubfh, LK_SHARED, &nvp, - &nes, NULL, 0); + &nes, NULL, 0, nextop); } else nd->nd_repstat = NFSERR_NOFILEHANDLE; if (!nd->nd_repstat) { @@ -1052,7 +1052,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, i < numops - 1); } nfsd_fhtovp(nd, &nfs_rootfh, LK_SHARED, &nvp, - &nes, NULL, 0); + &nes, NULL, 0, nextop); if (!nd->nd_repstat) { if (vp) vrele(vp); @@ -1110,13 +1110,21 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, nd->nd_repstat = 0; /* If vp == savevp, a no-op */ if (vp != savevp) { - VREF(savevp); - vrele(vp); - vp = savevp; - vpnes = savevpnes; - cur_fsid = save_fsid; + if (nfsrv_checkwrongsec(nd, nextop, + savevp->v_type)) + nd->nd_repstat = + nfsvno_testexp(nd, + &savevpnes); + if (nd->nd_repstat == 0) { + VREF(savevp); + vrele(vp); + vp = savevp; + vpnes = savevpnes; + cur_fsid = save_fsid; + } } - if ((nd->nd_flag & ND_SAVEDCURSTATEID) != 0) { + if (nd->nd_repstat == 0 && + (nd->nd_flag & ND_SAVEDCURSTATEID) != 0) { nd->nd_curstateid = nd->nd_savedcurstateid; nd->nd_flag |= ND_CURSTATEID; @@ -1143,14 +1151,9 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, op != NFSV4OP_GETFH && op != NFSV4OP_ACCESS && op != NFSV4OP_READLINK && - op != NFSV4OP_SECINFO) + op != NFSV4OP_SECINFO && + op != NFSV4OP_SECINFONONAME) nd->nd_repstat = NFSERR_NOFILEHANDLE; - else if (nfsvno_testexp(nd, &vpnes) && - op != NFSV4OP_LOOKUP && - op != NFSV4OP_GETFH && - op != NFSV4OP_GETATTR && - op != NFSV4OP_SECINFO) - nd->nd_repstat = NFSERR_WRONGSEC; if (nd->nd_repstat) { if (op == NFSV4OP_SETATTR) { /* @@ -1183,6 +1186,16 @@ tryagain: nd->nd_repstat = NFSERR_NOFILEHANDLE; break; } + if (NFSVNO_EXPORTED(&vpnes) && (op == NFSV4OP_LOOKUP || + op == NFSV4OP_LOOKUPP || (op == NFSV4OP_OPEN && + vp->v_type == VDIR))) { + /* Check for wrong security. */ + rstat = nfsvno_testexp(nd, &vpnes); + if (rstat != 0) { + nd->nd_repstat = rstat; + break; + } + } VREF(vp); if (nfsv4_opflag[op].modifyfs) vn_start_write(vp, &temp_mp, V_WAIT); @@ -1197,7 +1210,7 @@ tryagain: nd->nd_nam, &nes, &credanon); if (!nd->nd_repstat) nd->nd_repstat = nfsd_excred(nd, - &nes, credanon); + &nes, credanon, true); if (credanon != NULL) crfree(credanon); if (!nd->nd_repstat) { From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 22:59:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 5DC9A65B60A; Sat, 26 Jun 2021 22:59:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC8St2BjLz3v0v; Sat, 26 Jun 2021 22:59:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33AC026E76; Sat, 26 Jun 2021 22:59:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QMxQoT055686; Sat, 26 Jun 2021 22:59:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QMxQdu055685; Sat, 26 Jun 2021 22:59:26 GMT (envelope-from git) Date: Sat, 26 Jun 2021 22:59:26 GMT Message-Id: <202106262259.15QMxQdu055685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 6078d52fa12a - stable/13 - nfsd: Fix NFSv4.1/4.2 Secinfo_no_name when security flavors empty MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6078d52fa12adfbf3a7e54a6a228fff13c5ecd4a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 22:59:26 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6078d52fa12adfbf3a7e54a6a228fff13c5ecd4a commit 6078d52fa12adfbf3a7e54a6a228fff13c5ecd4a Author: Rick Macklem AuthorDate: 2021-06-05 03:31:20 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 22:56:10 +0000 nfsd: Fix NFSv4.1/4.2 Secinfo_no_name when security flavors empty Commit 947bd2479ba9 added support for the Secinfo_no_name operation. When a non-exported file system is being traversed, the list of security flavors is empty. It turns out that the Linux client mount attempt fails when the security flavors list in the Secinfo_no_name reply is empty. This patch modifies Secinfo/Secinfo_no_name so that it replies with all four security flavors when the list is empty. This fixes Linux NFSv4.1/4.2 mounts when the file system at the NFSv4 root (as specified on a V4: exports(5) line) is not exported. (cherry picked from commit 56e9d8e38e7eed84901acddca24170eb352d2ed6) --- sys/fs/nfsserver/nfs_nfsdserv.c | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index adb66d3d794d..e564a6a48b79 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -3715,6 +3715,31 @@ nfsrvd_secinfo(struct nfsrv_descript *nd, int isdgram, */ len = 0; NFSM_BUILD(sizp, u_int32_t *, NFSX_UNSIGNED); + + /* If nes_numsecflavor == 0, all are allowed. */ + if (retnes.nes_numsecflavor == 0) { + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(RPCAUTH_UNIX); + *tl = txdr_unsigned(RPCAUTH_GSS); + nfsm_strtom(nd, nfsgss_mechlist[KERBV_MECH].str, + nfsgss_mechlist[KERBV_MECH].len); + NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(GSS_KERBV_QOP); + *tl++ = txdr_unsigned(RPCAUTHGSS_SVCNONE); + *tl = txdr_unsigned(RPCAUTH_GSS); + nfsm_strtom(nd, nfsgss_mechlist[KERBV_MECH].str, + nfsgss_mechlist[KERBV_MECH].len); + NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(GSS_KERBV_QOP); + *tl++ = txdr_unsigned(RPCAUTHGSS_SVCINTEGRITY); + *tl = txdr_unsigned(RPCAUTH_GSS); + nfsm_strtom(nd, nfsgss_mechlist[KERBV_MECH].str, + nfsgss_mechlist[KERBV_MECH].len); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(GSS_KERBV_QOP); + *tl = txdr_unsigned(RPCAUTHGSS_SVCPRIVACY); + len = 4; + } for (i = 0; i < retnes.nes_numsecflavor; i++) { if (retnes.nes_secflavors[i] == AUTH_SYS) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); @@ -3830,6 +3855,31 @@ nfsrvd_secinfononame(struct nfsrv_descript *nd, int isdgram, */ len = 0; NFSM_BUILD(sizp, uint32_t *, NFSX_UNSIGNED); + + /* If nes_numsecflavor == 0, all are allowed. */ + if (retnes.nes_numsecflavor == 0) { + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(RPCAUTH_UNIX); + *tl = txdr_unsigned(RPCAUTH_GSS); + nfsm_strtom(nd, nfsgss_mechlist[KERBV_MECH].str, + nfsgss_mechlist[KERBV_MECH].len); + NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(GSS_KERBV_QOP); + *tl++ = txdr_unsigned(RPCAUTHGSS_SVCNONE); + *tl = txdr_unsigned(RPCAUTH_GSS); + nfsm_strtom(nd, nfsgss_mechlist[KERBV_MECH].str, + nfsgss_mechlist[KERBV_MECH].len); + NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(GSS_KERBV_QOP); + *tl++ = txdr_unsigned(RPCAUTHGSS_SVCINTEGRITY); + *tl = txdr_unsigned(RPCAUTH_GSS); + nfsm_strtom(nd, nfsgss_mechlist[KERBV_MECH].str, + nfsgss_mechlist[KERBV_MECH].len); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(GSS_KERBV_QOP); + *tl = txdr_unsigned(RPCAUTHGSS_SVCPRIVACY); + len = 4; + } for (i = 0; i < retnes.nes_numsecflavor; i++) { if (retnes.nes_secflavors[i] == AUTH_SYS) { NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 23:02:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 8AA5265B3C9; Sat, 26 Jun 2021 23:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC8X03XyGz3vL2; Sat, 26 Jun 2021 23:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62CE92739D; Sat, 26 Jun 2021 23:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QN28bF069056; Sat, 26 Jun 2021 23:02:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QN28Bk069055; Sat, 26 Jun 2021 23:02:08 GMT (envelope-from git) Date: Sat, 26 Jun 2021 23:02:08 GMT Message-Id: <202106262302.15QN28Bk069055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: b1caf1920f83 - stable/13 - nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b1caf1920f83fd6fe00602ec37a354e3ca4eba23 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 23:02:08 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b1caf1920f83fd6fe00602ec37a354e3ca4eba23 commit b1caf1920f83fd6fe00602ec37a354e3ca4eba23 Author: Rick Macklem AuthorDate: 2021-06-07 20:48:25 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 22:58:21 +0000 nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems Pre-r318997 the code looked like: if (vp->v_mount->mnt_stat.f_fsid.val[0] != (uint32_t)np->n_vattr.na_filesid[0]) vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0]; Doing this assignment got lost by r318997 and, as such, NFSv4 mounts of servers with trees of file systems on the server is broken, due to duplicate fileno values for the same st_dev/va_fsid. Although I could have re-introduced the assignment, since the value of na_filesid[0] is not guaranteed to be unique across the server file systems, I felt it was better to always do the hash for na_filesid[0,1]. Since dev_t (st_dev/va_fsid) is now 64bits, I switched to a 64bit hash. There is a slight chance of a hash conflict where 2 different na_filesid values map to same va_fsid, which will be documented in the BUGS section of the man page for mount_nfs(8). Using a table to keep track of mappings to catch conflicts would not easily scale to 10,000+ server file systems and, when the conflict occurs, it only results in fts(3) reporting a "directory cycle" under certain circumstances. (cherry picked from commit 03c81af24920e14bd977f34edcd3eb7fb122db19) --- sys/fs/nfsclient/nfs_clport.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 492b93340e4e..264d99626394 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -441,6 +441,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, struct nfsmount *nmp; struct timespec mtime_save; int error, force_fid_err; + dev_t topfsid; error = 0; @@ -504,28 +505,30 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, } /* - * For NFSv4, if the node's fsid is not equal to the mount point's - * fsid, return the low order 32bits of the node's fsid. This - * allows getcwd(3) to work. There is a chance that the fsid might - * be the same as a local fs, but since this is in an NFS mount - * point, I don't think that will cause any problems? + * For NFSv4, the server's export may be a tree of file systems + * where a fileno is a unique value within each file system. + * na_filesid[0,1] uniquely identify the server file system + * and nm_fsid[0,1] is the value for the root file system mounted. + * As such, the value of va_fsid generated by vn_fsid() represents + * the root file system on the server and a different value for + * va_fsid is needed for the other server file systems. This + * va_fsid is ideally unique for all of the server file systems, + * so a 64bit hash on na_filesid[0,1] is calculated. + * Although highly unlikely that the fnv_64_hash() will be + * the same as the root, test for this case and recalculate the hash. */ + vn_fsid(vp, vap); if (NFSHASNFSV4(nmp) && NFSHASHASSETFSID(nmp) && (nmp->nm_fsid[0] != np->n_vattr.na_filesid[0] || nmp->nm_fsid[1] != np->n_vattr.na_filesid[1])) { - /* - * va_fsid needs to be set to some value derived from - * np->n_vattr.na_filesid that is not equal - * vp->v_mount->mnt_stat.f_fsid[0], so that it changes - * from the value used for the top level server volume - * in the mounted subtree. - */ - vn_fsid(vp, vap); - if ((uint32_t)vap->va_fsid == np->n_vattr.na_filesid[0]) - vap->va_fsid = hash32_buf( - np->n_vattr.na_filesid, 2 * sizeof(uint64_t), 0); - } else - vn_fsid(vp, vap); + topfsid = vap->va_fsid; + vap->va_fsid = FNV1_64_INIT; + do { + vap->va_fsid = fnv_64_buf(np->n_vattr.na_filesid, + sizeof(np->n_vattr.na_filesid), vap->va_fsid); + } while (vap->va_fsid == topfsid); + } + np->n_attrstamp = time_second; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 23:04:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 3B8FB65B90C; Sat, 26 Jun 2021 23:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC8b01G6kz3vs7; Sat, 26 Jun 2021 23:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A16E27177; Sat, 26 Jun 2021 23:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QN4hlO069327; Sat, 26 Jun 2021 23:04:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QN4hCG069326; Sat, 26 Jun 2021 23:04:43 GMT (envelope-from git) Date: Sat, 26 Jun 2021 23:04:43 GMT Message-Id: <202106262304.15QN4hCG069326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 6c5dae287ee7 - stable/13 - nfscl: Add a "has acquired a delegation" flag for delegations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6c5dae287ee722036240bde5bc0b3a8d5a000836 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 23:04:44 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6c5dae287ee722036240bde5bc0b3a8d5a000836 commit 6c5dae287ee722036240bde5bc0b3a8d5a000836 Author: Rick Macklem AuthorDate: 2021-06-09 15:00:43 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 23:01:09 +0000 nfscl: Add a "has acquired a delegation" flag for delegations A problem was reported via email, where a large (130000+) accumulation of NFSv4 opens on an NFSv4 mount caused significant lock contention on the mutex used to protect the client mount's open/lock state. Although the root cause for the accumulation of opens was not resolved, it is obvious that the NFSv4 client is not designed to handle 100000+ opens efficiently. For a common case where delegations are not being issued by the NFSv4 server, the code acquires the mutex lock for open/lock state, finds the delegation list empty and just unlocks the mutex and returns. This patch adds an NFS mount point flag that is set when a delegation is issued for the mount. Then the patched code checks for this flag before acquiring the open/lock mutex, avoiding the need to acquire the lock for the case where delegations are not being issued by the NFSv4 server. This change appears to be performance neutral for a small number of opens, but should reduce lock contention for a large number of opens for the common case where server is not issuing delegations. This commit should not affect the high level semantics of delegation handling. (cherry picked from commit 5e5ca4c8fc53d31bf71e182e08c4ccd8290428c7) --- sys/fs/nfsclient/nfs_clstate.c | 44 +++++++++++++++++++++++++++++++++++++++--- sys/fs/nfsclient/nfsmount.h | 1 + 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 5e4ac2ae9d4d..0659e77289e9 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -438,20 +438,32 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp) { struct nfscldeleg *dp = *dpp, *tdp; + struct nfsmount *nmp; + KASSERT(mp != NULL, ("nfscl_deleg: mp NULL")); + nmp = VFSTONFS(mp); /* * First, if we have received a Read delegation for a file on a * read/write file system, just return it, because they aren't * useful, imho. */ - if (mp != NULL && dp != NULL && !NFSMNT_RDONLY(mp) && + if (dp != NULL && !NFSMNT_RDONLY(mp) && (dp->nfsdl_flags & NFSCLDL_READ)) { - (void) nfscl_trydelegreturn(dp, cred, VFSTONFS(mp), p); + nfscl_trydelegreturn(dp, cred, nmp, p); free(dp, M_NFSCLDELEG); *dpp = NULL; return (0); } + /* + * Since a delegation might be added to the mount, + * set NFSMNTP_DELEGISSUED now. If a delegation already + * exagain ists, setting this flag is harmless. + */ + NFSLOCKMNT(nmp); + nmp->nm_privflag |= NFSMNTP_DELEGISSUED; + NFSUNLOCKMNT(nmp); + /* Look for the correct deleg, based upon FH */ NFSLOCKCLSTATE(); tdp = nfscl_finddeleg(clp, nfhp, fhlen); @@ -3356,12 +3368,20 @@ nfscl_delegreturnvp(vnode_t vp, NFSPROC_T *p) struct nfscldeleg *dp; struct ucred *cred; struct nfsnode *np; + struct nfsmount *nmp; + nmp = VFSTONFS(vp->v_mount); + NFSLOCKMNT(nmp); + if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { + NFSUNLOCKMNT(nmp); + return; + } + NFSUNLOCKMNT(nmp); np = VTONFS(vp); cred = newnfs_getcred(); dp = NULL; NFSLOCKCLSTATE(); - clp = VFSTONFS(vp->v_mount)->nm_clp; + clp = nmp->nm_clp; if (clp != NULL) dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); @@ -4500,6 +4520,12 @@ nfscl_nodeleg(vnode_t vp, int writedeleg) nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return (1); + NFSLOCKMNT(nmp); + if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { + NFSUNLOCKMNT(nmp); + return (1); + } + NFSUNLOCKMNT(nmp); NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); if (clp == NULL) { @@ -4856,6 +4882,12 @@ nfscl_delegmodtime(vnode_t vp) nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return; + NFSLOCKMNT(nmp); + if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { + NFSUNLOCKMNT(nmp); + return; + } + NFSUNLOCKMNT(nmp); NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); if (clp == NULL) { @@ -4885,6 +4917,12 @@ nfscl_deleggetmodtime(vnode_t vp, struct timespec *mtime) nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return; + NFSLOCKMNT(nmp); + if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { + NFSUNLOCKMNT(nmp); + return; + } + NFSUNLOCKMNT(nmp); NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); if (clp == NULL) { diff --git a/sys/fs/nfsclient/nfsmount.h b/sys/fs/nfsclient/nfsmount.h index 57adcd8f2fca..f8ea8c9a1418 100644 --- a/sys/fs/nfsclient/nfsmount.h +++ b/sys/fs/nfsclient/nfsmount.h @@ -115,6 +115,7 @@ struct nfsmount { #define NFSMNTP_NOXATTR 0x00000080 #define NFSMNTP_NOADVISE 0x00000100 #define NFSMNTP_NOALLOCATE 0x00000200 +#define NFSMNTP_DELEGISSUED 0x00000400 /* New mount flags only used by the kernel via nmount(2). */ #define NFSMNT_TLS 0x00000001 From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 23:08:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 CF90A65B559; Sat, 26 Jun 2021 23:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC8gt5JhFz3vqp; Sat, 26 Jun 2021 23:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EC4E2733C; Sat, 26 Jun 2021 23:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QN8wbK069724; Sat, 26 Jun 2021 23:08:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QN8w0F069723; Sat, 26 Jun 2021 23:08:58 GMT (envelope-from git) Date: Sat, 26 Jun 2021 23:08:58 GMT Message-Id: <202106262308.15QN8w0F069723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 841006678745 - stable/13 - krpc: Acquire ref count of CLIENT for backchannel use MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 841006678745a63f7c9f298f0a48cbbb1712f8a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 23:08:58 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=841006678745a63f7c9f298f0a48cbbb1712f8a0 commit 841006678745a63f7c9f298f0a48cbbb1712f8a0 Author: Rick Macklem AuthorDate: 2021-06-11 23:57:14 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 23:03:41 +0000 krpc: Acquire ref count of CLIENT for backchannel use Michael Dexter reported a crash in FreeNAS, where the first argument to clnt_bck_svccall() was no longer valid. This argument is a pointer to the callback CLIENT structure, which is free'd when the associated NFSv4 ClientID is free'd. This appears to have occurred because a callback reply was still in the socket receive queue when the CLIENT structure was free'd. This patch acquires a reference count on the CLIENT that is not CLNT_RELEASE()'d until the socket structure is destroyed. This should guarantee that the CLIENT structure is still valid when clnt_bck_svccall() is called. It also adds a check for closed or closing to clnt_bck_svccall() so that it will not process the callback RPC reply message after the ClientID is free'd. (cherry picked from commit e1a907a25cfa422c0d1acaf9f91352ada04f4bca) --- sys/fs/nfsserver/nfs_nfsdstate.c | 8 ++++---- sys/rpc/clnt_bck.c | 13 ++++++++++++- sys/rpc/svc.h | 5 +++++ sys/rpc/svc_vc.c | 4 ++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index c16d5b8afdc8..98f5e26d49bb 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -721,8 +721,8 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, cbprogram, NFSV4_CBVERS); if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); - nd->nd_xprt->xp_p2 = - clp->lc_req.nr_client->cl_private; + CLNT_ACQUIRE(clp->lc_req.nr_client); + nd->nd_xprt->xp_p2 = clp->lc_req.nr_client; /* Disable idle timeout. */ nd->nd_xprt->xp_idletimeout = 0; nsep->sess_cbsess.nfsess_xprt = nd->nd_xprt; @@ -6464,8 +6464,8 @@ nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t *sessionid, int *foreaftp) "backchannel\n"); savxprt = sep->sess_cbsess.nfsess_xprt; SVC_ACQUIRE(nd->nd_xprt); - nd->nd_xprt->xp_p2 = - clp->lc_req.nr_client->cl_private; + CLNT_ACQUIRE(clp->lc_req.nr_client); + nd->nd_xprt->xp_p2 = clp->lc_req.nr_client; /* Disable idle timeout. */ nd->nd_xprt->xp_idletimeout = 0; sep->sess_cbsess.nfsess_xprt = nd->nd_xprt; diff --git a/sys/rpc/clnt_bck.c b/sys/rpc/clnt_bck.c index 29109720bce0..2414171bad37 100644 --- a/sys/rpc/clnt_bck.c +++ b/sys/rpc/clnt_bck.c @@ -566,15 +566,26 @@ clnt_bck_destroy(CLIENT *cl) /* * This call is done by the svc code when a backchannel RPC reply is * received. + * For the server end, where callback RPCs to the client are performed, + * xp_p2 points to the "CLIENT" and not the associated "struct ct_data" + * so that svc_vc_destroy() can CLNT_RELEASE() the reference count on it. */ void clnt_bck_svccall(void *arg, struct mbuf *mrep, uint32_t xid) { - struct ct_data *ct = (struct ct_data *)arg; + CLIENT *cl = (CLIENT *)arg; + struct ct_data *ct; struct ct_request *cr; int foundreq; + ct = (struct ct_data *)cl->cl_private; mtx_lock(&ct->ct_lock); + if (ct->ct_closing || ct->ct_closed) { + mtx_unlock(&ct->ct_lock); + m_freem(mrep); + return; + } + ct->ct_upcallrefs++; /* * See if we can match this reply to a request. diff --git a/sys/rpc/svc.h b/sys/rpc/svc.h index dae654d4b08c..8a94d7058972 100644 --- a/sys/rpc/svc.h +++ b/sys/rpc/svc.h @@ -148,6 +148,11 @@ struct __rpc_svcthread; * reference count which tracks the number of currently assigned * worker threads plus one for the service pool's reference. * For NFSv4.1 sessions, a reference is also held for a backchannel. + * xp_p2 - Points to the CLIENT structure for the RPC server end + * (the client end for callbacks). + * Points to the private structure (cl_private) for the + * CLIENT structure for the RPC client end (the server + * end for callbacks). */ typedef struct __rpc_svcxprt { #ifdef _KERNEL diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index 67951108b01c..234feba5c8bd 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -500,6 +500,7 @@ static void svc_vc_destroy(SVCXPRT *xprt) { struct cf_conn *cd = (struct cf_conn *)xprt->xp_p1; + CLIENT *cl = (CLIENT *)xprt->xp_p2; SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); if (xprt->xp_upcallset) { @@ -509,6 +510,9 @@ svc_vc_destroy(SVCXPRT *xprt) } SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); + if (cl != NULL) + CLNT_RELEASE(cl); + svc_vc_destroy_common(xprt); if (cd->mreq) From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 23:16:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 521DB65BA1F; Sat, 26 Jun 2021 23:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC8rk1mVqz4QxP; Sat, 26 Jun 2021 23:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24CD6276FE; Sat, 26 Jun 2021 23:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QNGcaP082490; Sat, 26 Jun 2021 23:16:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QNGcvd082489; Sat, 26 Jun 2021 23:16:38 GMT (envelope-from git) Date: Sat, 26 Jun 2021 23:16:38 GMT Message-Id: <202106262316.15QNGcvd082489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: eb3397588e1b - stable/13 - param.h: Bump __FreeBSD_version to 1300510 for commit 841006678745 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eb3397588e1b48043e166587ea454f60efea88d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 23:16:38 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=eb3397588e1b48043e166587ea454f60efea88d0 commit eb3397588e1b48043e166587ea454f60efea88d0 Author: Rick Macklem AuthorDate: 2021-06-26 23:13:49 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 23:13:49 +0000 param.h: Bump __FreeBSD_version to 1300510 for commit 841006678745 Commit 841006678745 changed the internal KAPI between the krpc and nfsd modules. As such, they must both be rebuilt from sources. This is a direct commit. --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 9a5716635a2f..6e75123fca77 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300509 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300510 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 23:23:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 D6CC365BD67; Sat, 26 Jun 2021 23:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC9045hJgz4QtY; Sat, 26 Jun 2021 23:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB5AD2747D; Sat, 26 Jun 2021 23:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QNN0cR095967; Sat, 26 Jun 2021 23:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QNN09x095966; Sat, 26 Jun 2021 23:23:00 GMT (envelope-from git) Date: Sat, 26 Jun 2021 23:23:00 GMT Message-Id: <202106262323.15QNN09x095966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: d6805ab0df54 - stable/13 - UPDATING: Add entry for commit 841006678745 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d6805ab0df5419bb2c7f23aa0ad8e2af6c579ccc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 23:23:00 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d6805ab0df5419bb2c7f23aa0ad8e2af6c579ccc commit d6805ab0df5419bb2c7f23aa0ad8e2af6c579ccc Author: Rick Macklem AuthorDate: 2021-06-26 23:20:19 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 23:20:19 +0000 UPDATING: Add entry for commit 841006678745 This is a direct commit. --- UPDATING | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UPDATING b/UPDATING index f7e3996e8d48..7c7dcae62587 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,12 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20210626: + Commit 841006678745 changed the internal KAPI between the krpc + and nfsd modules. As such, they must both be rebuilt from + sources. + __FreeBSD_version is bumped to 1300510. + 20210510: Commit 272f39942254 changed the internal KAPI between the nscl.ko and nfscommon.ko modules, so they both need to be From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 23:37:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 1873865BE0F; Sat, 26 Jun 2021 23:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC9KK6qmvz4Rhf; Sat, 26 Jun 2021 23:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D304B278C2; Sat, 26 Jun 2021 23:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QNbv8Q009359; Sat, 26 Jun 2021 23:37:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QNbvBw009358; Sat, 26 Jun 2021 23:37:57 GMT (envelope-from git) Date: Sat, 26 Jun 2021 23:37:57 GMT Message-Id: <202106262337.15QNbvBw009358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 88878ea4e410 - stable/12 - nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 88878ea4e410d8ad8e5394cc83a019da29db8d79 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 23:37:58 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=88878ea4e410d8ad8e5394cc83a019da29db8d79 commit 88878ea4e410d8ad8e5394cc83a019da29db8d79 Author: Rick Macklem AuthorDate: 2021-06-07 20:48:25 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 23:34:30 +0000 nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems Pre-r318997 the code looked like: if (vp->v_mount->mnt_stat.f_fsid.val[0] != (uint32_t)np->n_vattr.na_filesid[0]) vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0]; Doing this assignment got lost by r318997 and, as such, NFSv4 mounts of servers with trees of file systems on the server is broken, due to duplicate fileno values for the same st_dev/va_fsid. Although I could have re-introduced the assignment, since the value of na_filesid[0] is not guaranteed to be unique across the server file systems, I felt it was better to always do the hash for na_filesid[0,1]. Since dev_t (st_dev/va_fsid) is now 64bits, I switched to a 64bit hash. There is a slight chance of a hash conflict where 2 different na_filesid values map to same va_fsid, which will be documented in the BUGS section of the man page for mount_nfs(8). Using a table to keep track of mappings to catch conflicts would not easily scale to 10,000+ server file systems and, when the conflict occurs, it only results in fts(3) reporting a "directory cycle" under certain circumstances. (cherry picked from commit 03c81af24920e14bd977f34edcd3eb7fb122db19) --- sys/fs/nfsclient/nfs_clport.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 20500a290ff0..97cde6421da2 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -439,6 +439,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, struct nfsmount *nmp; struct timespec mtime_save; int error, force_fid_err; + dev_t topfsid; error = 0; @@ -501,28 +502,30 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, } /* - * For NFSv4, if the node's fsid is not equal to the mount point's - * fsid, return the low order 32bits of the node's fsid. This - * allows getcwd(3) to work. There is a chance that the fsid might - * be the same as a local fs, but since this is in an NFS mount - * point, I don't think that will cause any problems? + * For NFSv4, the server's export may be a tree of file systems + * where a fileno is a unique value within each file system. + * na_filesid[0,1] uniquely identify the server file system + * and nm_fsid[0,1] is the value for the root file system mounted. + * As such, the value of va_fsid generated by vn_fsid() represents + * the root file system on the server and a different value for + * va_fsid is needed for the other server file systems. This + * va_fsid is ideally unique for all of the server file systems, + * so a 64bit hash on na_filesid[0,1] is calculated. + * Although highly unlikely that the fnv_64_hash() will be + * the same as the root, test for this case and recalculate the hash. */ + vn_fsid(vp, vap); if (NFSHASNFSV4(nmp) && NFSHASHASSETFSID(nmp) && (nmp->nm_fsid[0] != np->n_vattr.na_filesid[0] || nmp->nm_fsid[1] != np->n_vattr.na_filesid[1])) { - /* - * va_fsid needs to be set to some value derived from - * np->n_vattr.na_filesid that is not equal - * vp->v_mount->mnt_stat.f_fsid[0], so that it changes - * from the value used for the top level server volume - * in the mounted subtree. - */ - vn_fsid(vp, vap); - if ((uint32_t)vap->va_fsid == np->n_vattr.na_filesid[0]) - vap->va_fsid = hash32_buf( - np->n_vattr.na_filesid, 2 * sizeof(uint64_t), 0); - } else - vn_fsid(vp, vap); + topfsid = vap->va_fsid; + vap->va_fsid = FNV1_64_INIT; + do { + vap->va_fsid = fnv_64_buf(np->n_vattr.na_filesid, + sizeof(np->n_vattr.na_filesid), vap->va_fsid); + } while (vap->va_fsid == topfsid); + } + np->n_attrstamp = time_second; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 23:42:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 50A6865BC70; Sat, 26 Jun 2021 23:42:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC9Q51nZZz4Rmb; Sat, 26 Jun 2021 23:42:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 268BA27AC2; Sat, 26 Jun 2021 23:42:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QNg5OM020453; Sat, 26 Jun 2021 23:42:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QNg52Z020452; Sat, 26 Jun 2021 23:42:05 GMT (envelope-from git) Date: Sat, 26 Jun 2021 23:42:05 GMT Message-Id: <202106262342.15QNg52Z020452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 6ae32cc8182f - stable/12 - krpc: Acquire ref count of CLIENT for backchannel use MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6ae32cc8182f4a48f0606f4b561a98010e1946b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 23:42:05 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6ae32cc8182f4a48f0606f4b561a98010e1946b8 commit 6ae32cc8182f4a48f0606f4b561a98010e1946b8 Author: Rick Macklem AuthorDate: 2021-06-11 23:57:14 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 23:36:37 +0000 krpc: Acquire ref count of CLIENT for backchannel use Michael Dexter reported a crash in FreeNAS, where the first argument to clnt_bck_svccall() was no longer valid. This argument is a pointer to the callback CLIENT structure, which is free'd when the associated NFSv4 ClientID is free'd. This appears to have occurred because a callback reply was still in the socket receive queue when the CLIENT structure was free'd. This patch acquires a reference count on the CLIENT that is not CLNT_RELEASE()'d until the socket structure is destroyed. This should guarantee that the CLIENT structure is still valid when clnt_bck_svccall() is called. It also adds a check for closed or closing to clnt_bck_svccall() so that it will not process the callback RPC reply message after the ClientID is free'd. (cherry picked from commit e1a907a25cfa422c0d1acaf9f91352ada04f4bca) --- sys/fs/nfsserver/nfs_nfsdstate.c | 8 ++++---- sys/rpc/clnt_bck.c | 13 ++++++++++++- sys/rpc/svc.h | 5 +++++ sys/rpc/svc_vc.c | 4 ++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index abd4099a7ee2..3423eddc7366 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -722,8 +722,8 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, cbprogram, NFSV4_CBVERS); if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); - nd->nd_xprt->xp_p2 = - clp->lc_req.nr_client->cl_private; + CLNT_ACQUIRE(clp->lc_req.nr_client); + nd->nd_xprt->xp_p2 = clp->lc_req.nr_client; /* Disable idle timeout. */ nd->nd_xprt->xp_idletimeout = 0; nsep->sess_cbsess.nfsess_xprt = nd->nd_xprt; @@ -6440,8 +6440,8 @@ nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t *sessionid, int *foreaftp) "backchannel\n"); savxprt = sep->sess_cbsess.nfsess_xprt; SVC_ACQUIRE(nd->nd_xprt); - nd->nd_xprt->xp_p2 = - clp->lc_req.nr_client->cl_private; + CLNT_ACQUIRE(clp->lc_req.nr_client); + nd->nd_xprt->xp_p2 = clp->lc_req.nr_client; /* Disable idle timeout. */ nd->nd_xprt->xp_idletimeout = 0; sep->sess_cbsess.nfsess_xprt = nd->nd_xprt; diff --git a/sys/rpc/clnt_bck.c b/sys/rpc/clnt_bck.c index 66f3c308e8e1..7e4a28f229e5 100644 --- a/sys/rpc/clnt_bck.c +++ b/sys/rpc/clnt_bck.c @@ -546,15 +546,26 @@ clnt_bck_destroy(CLIENT *cl) /* * This call is done by the svc code when a backchannel RPC reply is * received. + * For the server end, where callback RPCs to the client are performed, + * xp_p2 points to the "CLIENT" and not the associated "struct ct_data" + * so that svc_vc_destroy() can CLNT_RELEASE() the reference count on it. */ void clnt_bck_svccall(void *arg, struct mbuf *mrep, uint32_t xid) { - struct ct_data *ct = (struct ct_data *)arg; + CLIENT *cl = (CLIENT *)arg; + struct ct_data *ct; struct ct_request *cr; int foundreq; + ct = (struct ct_data *)cl->cl_private; mtx_lock(&ct->ct_lock); + if (ct->ct_closing || ct->ct_closed) { + mtx_unlock(&ct->ct_lock); + m_freem(mrep); + return; + } + ct->ct_upcallrefs++; /* * See if we can match this reply to a request. diff --git a/sys/rpc/svc.h b/sys/rpc/svc.h index b60b85ef0f53..f5e3fcad3ff1 100644 --- a/sys/rpc/svc.h +++ b/sys/rpc/svc.h @@ -148,6 +148,11 @@ struct __rpc_svcthread; * reference count which tracks the number of currently assigned * worker threads plus one for the service pool's reference. * For NFSv4.1 sessions, a reference is also held for a backchannel. + * xp_p2 - Points to the CLIENT structure for the RPC server end + * (the client end for callbacks). + * Points to the private structure (cl_private) for the + * CLIENT structure for the RPC client end (the server + * end for callbacks). */ typedef struct __rpc_svcxprt { #ifdef _KERNEL diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index dd6b801f44be..f1546615d2df 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -474,6 +474,7 @@ static void svc_vc_destroy(SVCXPRT *xprt) { struct cf_conn *cd = (struct cf_conn *)xprt->xp_p1; + CLIENT *cl = (CLIENT *)xprt->xp_p2; SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); if (xprt->xp_upcallset) { @@ -482,6 +483,9 @@ svc_vc_destroy(SVCXPRT *xprt) } SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); + if (cl != NULL) + CLNT_RELEASE(cl); + svc_vc_destroy_common(xprt); if (cd->mreq) From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 23:51:20 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 BCD8E65C033; Sat, 26 Jun 2021 23:51:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC9cm518wz4S48; Sat, 26 Jun 2021 23:51:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 932B227CD4; Sat, 26 Jun 2021 23:51:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QNpK7c033417; Sat, 26 Jun 2021 23:51:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QNpKs7033416; Sat, 26 Jun 2021 23:51:20 GMT (envelope-from git) Date: Sat, 26 Jun 2021 23:51:20 GMT Message-Id: <202106262351.15QNpKs7033416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 489236b04748 - stable/12 - param.h: Bump __FreeBSD_version for commit 6ae32cc8182f MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 489236b0474857b0a7a2df77c302290e12be9e7b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 23:51:20 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=489236b0474857b0a7a2df77c302290e12be9e7b commit 489236b0474857b0a7a2df77c302290e12be9e7b Author: Rick Macklem AuthorDate: 2021-06-26 23:47:59 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 23:47:59 +0000 param.h: Bump __FreeBSD_version for commit 6ae32cc8182f Commit 6ae32cc8182f changed the internal KAPI between the krpc and nfsd modules. As such, both need to be rebuilt from sources. Bump __FreeBSD_version to 1202508. This is a direct commit. --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 1e3fd909956a..15099849688d 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1202507 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202508 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-branches@freebsd.org Sat Jun 26 23:55:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 CF29765C460; Sat, 26 Jun 2021 23:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GC9k35VT7z4SX0; Sat, 26 Jun 2021 23:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A08EA27AFE; Sat, 26 Jun 2021 23:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15QNttmn035518; Sat, 26 Jun 2021 23:55:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15QNtt1C035517; Sat, 26 Jun 2021 23:55:55 GMT (envelope-from git) Date: Sat, 26 Jun 2021 23:55:55 GMT Message-Id: <202106262355.15QNtt1C035517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 368799beba4a - stable/12 - UPDATING: Add an entry for commit 6ae32cc8182f MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 368799beba4a933592c58e0390933df02a66d24b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 23:55:55 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=368799beba4a933592c58e0390933df02a66d24b commit 368799beba4a933592c58e0390933df02a66d24b Author: Rick Macklem AuthorDate: 2021-06-26 23:53:13 +0000 Commit: Rick Macklem CommitDate: 2021-06-26 23:53:13 +0000 UPDATING: Add an entry for commit 6ae32cc8182f This is a direct commit. --- UPDATING | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPDATING b/UPDATING index f1dceda848e2..83cf3b8e6ffa 100644 --- a/UPDATING +++ b/UPDATING @@ -17,6 +17,11 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20210626: + Commit 6ae32cc8182f changed the internal KAPI between the krpc and + nfsd modules. As such, both need to be rebuilt from sources. + Bump __FreeBSD_version to 1202508. + 20210510: Commit e9959506d2cc changed the internal KAPI between the nscl.ko and nfscommon.ko modules, so they both need to be