From owner-svn-src-stable-11@freebsd.org Mon Sep 28 11:48:20 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAA863FF669; Mon, 28 Sep 2020 11:48:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0LPc5VNQz4HSM; Mon, 28 Sep 2020 11:48:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A11AF1D1F1; Mon, 28 Sep 2020 11:48:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SBmKx3051645; Mon, 28 Sep 2020 11:48:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SBmKFv051644; Mon, 28 Sep 2020 11:48:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009281148.08SBmKFv051644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 28 Sep 2020 11:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366221 - stable/11/sys/netgraph X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/netgraph X-SVN-Commit-Revision: 366221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 11:48:20 -0000 Author: markj Date: Mon Sep 28 11:48:20 2020 New Revision: 366221 URL: https://svnweb.freebsd.org/changeset/base/366221 Log: MFC r366167: ng_l2tp: Fix callout synchronization in the rexmit timeout handler PR: 241133 Modified: stable/11/sys/netgraph/ng_l2tp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netgraph/ng_l2tp.c ============================================================================== --- stable/11/sys/netgraph/ng_l2tp.c Mon Sep 28 11:46:03 2020 (r366220) +++ stable/11/sys/netgraph/ng_l2tp.c Mon Sep 28 11:48:20 2020 (r366221) @@ -1454,15 +1454,17 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, voi struct mbuf *m; u_int delay; - /* Make sure callout is still active before doing anything */ - if (callout_pending(&seq->rack_timer) || - (!callout_active(&seq->rack_timer))) - return; - /* Sanity check */ L2TP_SEQ_CHECK(seq); mtx_lock(&seq->mtx); + /* Make sure callout is still active before doing anything */ + if (callout_pending(&seq->rack_timer) || + !callout_active(&seq->rack_timer)) { + mtx_unlock(&seq->mtx); + return; + } + priv->stats.xmitRetransmits++; /* Have we reached the retransmit limit? If so, notify owner. */ From owner-svn-src-stable-11@freebsd.org Mon Sep 28 13:56:35 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E397F423C98; Mon, 28 Sep 2020 13:56:35 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0PFb5h9lz4QDK; Mon, 28 Sep 2020 13:56:35 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A78011E94F; Mon, 28 Sep 2020 13:56:35 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SDuZtO031715; Mon, 28 Sep 2020 13:56:35 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SDuZ28031713; Mon, 28 Sep 2020 13:56:35 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009281356.08SDuZ28031713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Sep 2020 13:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366225 - in stable/11: share/man/man4 usr.sbin/spi X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in stable/11: share/man/man4 usr.sbin/spi X-SVN-Commit-Revision: 366225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 13:56:36 -0000 Author: 0mp (doc,ports committer) Date: Mon Sep 28 13:56:35 2020 New Revision: 366225 URL: https://svnweb.freebsd.org/changeset/base/366225 Log: MFC 364454, 364453: 1. Reference spi(8) from spigen.4 2. Clean up spi.8 - Remove trailing whitespace - Address igor and mandoc warnings - Sort options - Use macros consistently (e.g., Fl for flags, Dq for quoting, Bd for code blocks) - Add a history section - Fix incorrect use of macros in various places Modified: stable/11/share/man/man4/spigen.4 stable/11/usr.sbin/spi/spi.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/spigen.4 ============================================================================== --- stable/11/share/man/man4/spigen.4 Mon Sep 28 13:52:18 2020 (r366224) +++ stable/11/share/man/man4/spigen.4 Mon Sep 28 13:56:35 2020 (r366225) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2018 +.Dd August 21, 2020 .Dt SPIGEN 4 .Os .Sh NAME @@ -195,7 +195,8 @@ Empty property indicating the slave device requires ch .El .Sh SEE ALSO .Xr fdt 4 , -.Xr device.hints 5 +.Xr device.hints 5 , +.Xr spi 8 .Sh HISTORY The .Nm Modified: stable/11/usr.sbin/spi/spi.8 ============================================================================== --- stable/11/usr.sbin/spi/spi.8 Mon Sep 28 13:52:18 2020 (r366224) +++ stable/11/usr.sbin/spi/spi.8 Mon Sep 28 13:56:35 2020 (r366225) @@ -1,5 +1,5 @@ .\" Copyright (c) 2018 by S.F.T. Inc. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -23,28 +23,28 @@ .\" .\" $FreeBSD$ .\" -.Dd "15 April 2018" -.Dt spi 8 +.Dd August 21, 2020 +.Dt SPI 8 .Os .Sh NAME .Nm spi .Nd communicate on SPI bus with slave devices .Sh SYNOPSIS .Nm -.Op Fl f Ar device -.Op Fl d Ar r|w|rw -.Op Fl m Ar mode -.Op Fl s Ar max-speed -.Op Fl c Ar count -.Op Fl C Ar cmd_bytes .Op Fl A .Op Fl b .Op Fl L .Op Fl v +.Op Fl C Ar command-bytes +.Op Fl c Ar count +.Op Fl d Cm r Ns | Ns Cm w Ns | Ns Cm rw +.Op Fl f Ar device +.Op Fl m Ar mode +.Op Fl s Ar max-speed .Nm .Op Fl i -.Op Fl f Ar device .Op Fl v +.Op Fl f Ar device .Nm .Op Fl h .Sh DESCRIPTION @@ -59,26 +59,26 @@ device. Each .Xr spigen 4 device is associated with a specific -.Sq chip select +.Dq chip select .Pq cs pin on the spibus, and therefore needs to be specified. If no device name is specified on the command line, .Nm assumes -.Sq spigen0.0 . +.Dq spigen0.0 . .Pp For more information on the spigen device, see .Xr spigen 4 . .Pp The options are as follows: -.Bl -tag -width ".Fl f Ar device" +.Bl -tag -width "-f device" .It Fl A Specifies ASCII mode. Both read and write data is input and output as 2-character hexadecimal values, optionally separated by white space, such as 00 01 02 etc. When combined with the -.Sq -b +.Fl b flag, the data on stdin remains a sequence of ASCII hexadecimal byte values, but the output reverts to binary mode. .It Fl b @@ -86,24 +86,23 @@ Binary .Pq output mode. Only has an effect when -.Sq -A +.Fl A has been specified. Reverts the output back to binary .Pq rather than ASCII , while leaving the input format as-is. Use in combination with -.Sq -A +.Fl A to allow using something like -.Sq echo +.Dq echo to pass hexadecimal values to the SPI device, but output the received data on stdout as binary. -.It Fl C Ar command bytes -Sends one or more -.Sq command -bytes, skipping any bytes read-in during the transfer. +.It Fl C Ar command-bytes +Sends one or more command bytes, +skipping any bytes read-in during the transfer. The byte values should be specified as a quoted parameter, similar to the format for data on stdin for -.Sq -A , +.Fl A , that is, 2 character hexadecimal values, optionally separated by white space. An SPI device will typically require that a command be sent, followed by bytes of data. @@ -114,22 +113,23 @@ The total number of bytes to transfer as a decimal int If a write or a read/write transaction is being performed, and fewer than this number of bytes are read in from stdin, the remaining bytes will be sent with a value of -.Sq 0 . +.Dq 0 . If the length can be determined from the input file size, you can use a -.Sq count +.Ar count value of -.Sq -1 +.Dq -1 to base the transfer on the input file's size. -.It Fl d Ar r|w|rw +.It Fl d Cm r Ns | Ns Cm w Ns | Ns Cm rw Transfer direction: Use -.Sq r +.Cm r for read, -.Sq w for write, and -.Sq rw +.Cm w +for write, and +.Cm rw for simultaneous read and write. .It Fl f Ar device SPI device to use -.Pq default is /dev/spigen0 . +.Pq default is Pa /dev/spigen0 . .It Fl h Print help text to stderr, explaining the command line options. .It Fl i @@ -140,8 +140,10 @@ and clock speed are not changed. LSB bit order. The default is MSB, i.e., the highest order bit is transmitted first. -Specifying -L caused the LSB to be transmitted and read first. -.It Fl m Ar 0 - 3 +Specifying +.Fl L +caused the LSB to be transmitted and read first. +.It Fl m Cm 0 Ns | Ns Cm 1 Ns | Ns Cm 2 Ns | Ns Cm 3 SPI mode, 0 through 3. This defines the clock phase and timing with respect to reading and writing data, as per the SPI specification. @@ -153,7 +155,7 @@ exceed this maximum. Specifies Verbose mode. Diagnostics and information are written to stderr. You can specify -.Sq -v +.Fl v more than once to increase verbosity. .El .Sh EXAMPLES @@ -161,43 +163,54 @@ Here are a few examples of using the spi utility: .Bl -bullet .It Get information about the default SPI device -.Pp +.Bd -literal spi -i +.Ed .It Set the maximum clock speed to 200Khz and the mode to 3 on spigen0.1, but do not transmit nor receive any data -.Pp +.Bd -literal spi -f spigen0.1 -s 200000 -m 3 +.Ed .It Send a command sequence consisting of 2 bytes, and read 2 additional bytes from the SPI device, using the current mode and speed on the default device -.Pp +.Bd -literal spi -d r -C "00 01" -c 2 +.Ed .It Transmit a byte value of 5, and receive 2 bytes, displaying their values as 2-byte ASCII hexadecimal, with mode 2, and a maximum clock speed of 500khz. -.Pp +.Bd -literal echo "05" | spi -A -d rw -m 2 -s 500000 -c 2 +.Ed .It Send a binary file, and output the SPI result through -.Sq od +.Xr od 1 as hexadecimal bytes, using the current maximum clock speed and SPI mode. -.Pp +.Bd -literal spi -d rw -c -1 Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3786042CB67; Mon, 28 Sep 2020 22:11:33 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0cDj0KY0z3dl7; Mon, 28 Sep 2020 22:11:33 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2BB4247BE; Mon, 28 Sep 2020 22:11:32 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SMBWMT040495; Mon, 28 Sep 2020 22:11:32 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SMBWLK040494; Mon, 28 Sep 2020 22:11:32 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009282211.08SMBWLK040494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Sep 2020 22:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366234 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 366234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 22:11:33 -0000 Author: 0mp (doc,ports committer) Date: Mon Sep 28 22:11:32 2020 New Revision: 366234 URL: https://svnweb.freebsd.org/changeset/base/366234 Log: MFC r364342: Use complete OIDs to avoid confusion Submitted by: otis_sk.freebsd.org Differential Revision: https://reviews.freebsd.org/D26098 Modified: stable/11/share/man/man4/bnxt.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/bnxt.4 ============================================================================== --- stable/11/share/man/man4/bnxt.4 Mon Sep 28 22:10:08 2020 (r366233) +++ stable/11/share/man/man4/bnxt.4 Mon Sep 28 22:11:32 2020 (r366234) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2017 +.Dd August 18, 2020 .Dt BNXT 4 .Os .Sh NAME @@ -129,15 +129,15 @@ completion ring, and the size of the transmit ring res The completion ring should be at least twice the size of the transmit ring. These numbers must be powers of two, and zero means to use the default. Defaults to 0,0. -.It Va override_qs_enable +.It Va dev.bnxt.X.iflib.override_qs_enable When set, allows the number of transmit and receive queues to be different. If not set, the lower of the number of TX or RX queues will be used for both. -.It Va override_nrxqs +.It Va dev.bnxt.X.iflib.override_nrxqs Set the number of RX queues. If zero, the number of RX queues is derived from the number of cores on the socket connected to the controller. Defaults to 0. -.It Va override_ntxqs +.It Va dev.bnxt.X.iflib.override_ntxqs Set the number of TX queues. If zero, the number of TX queues is derived from the number of cores on the socket connected to the controller. From owner-svn-src-stable-11@freebsd.org Mon Sep 28 22:16:30 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7426E42D10E; Mon, 28 Sep 2020 22:16:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0cLQ2Rsjz3dyL; Mon, 28 Sep 2020 22:16:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33D9A2499A; Mon, 28 Sep 2020 22:16:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SMGUxi042216; Mon, 28 Sep 2020 22:16:30 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SMGTiL042215; Mon, 28 Sep 2020 22:16:29 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009282216.08SMGTiL042215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Sep 2020 22:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366236 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 366236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 22:16:30 -0000 Author: 0mp (doc,ports committer) Date: Mon Sep 28 22:16:29 2020 New Revision: 366236 URL: https://svnweb.freebsd.org/changeset/base/366236 Log: MFC r364387: Cross-reference development.7 and tests.7 Modified: stable/11/share/man/man7/development.7 stable/11/share/man/man7/tests.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/development.7 ============================================================================== --- stable/11/share/man/man7/development.7 Mon Sep 28 22:13:07 2020 (r366235) +++ stable/11/share/man/man7/development.7 Mon Sep 28 22:16:29 2020 (r366236) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2013 +.Dd August 19, 2020 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -462,6 +462,7 @@ operations you do will be done as .Xr firewall 7 , .Xr release 7 , .Xr tuning 7 , +.Xr tests 7 , .Xr diskless 8 .Sh HISTORY The Modified: stable/11/share/man/man7/tests.7 ============================================================================== --- stable/11/share/man/man7/tests.7 Mon Sep 28 22:13:07 2020 (r366235) +++ stable/11/share/man/man7/tests.7 Mon Sep 28 22:16:29 2020 (r366236) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 21, 2017 +.Dd August 19, 2020 .Dt TESTS 7 .Os .Sh NAME @@ -222,7 +222,8 @@ Top-level test suite definition file. .El .Sh SEE ALSO .Xr kyua 1 , -.Xr build 7 +.Xr build 7 , +.Xr development 7 .Sh HISTORY The .Fx From owner-svn-src-stable-11@freebsd.org Tue Sep 29 02:03:25 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55AEF3F2350; Tue, 29 Sep 2020 02:03:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0jNF1bnwz48tZ; Tue, 29 Sep 2020 02:03:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B03D2751D; Tue, 29 Sep 2020 02:03:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T23OTG083473; Tue, 29 Sep 2020 02:03:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T23OrV083472; Tue, 29 Sep 2020 02:03:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202009290203.08T23OrV083472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 29 Sep 2020 02:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366241 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 366241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 02:03:25 -0000 Author: rmacklem Date: Tue Sep 29 02:03:24 2020 New Revision: 366241 URL: https://svnweb.freebsd.org/changeset/base/366241 Log: MFC: r366189 Bjorn reported a problem where the Linux NFSv4.1 client is using an open_to_lock_owner4 when that lock_owner4 has already been created by a previous open_to_lock_owner4. This caused the NFS server to reply NFSERR_INVAL. For NFSv4.0, this is an error, although the updated NFSv4.0 RFC7530 notes that the correct error reply is NFSERR_BADSEQID (RFC3530 did not specify what error to return). For NFSv4.1, it is not obvious whether or not this is allowed by RFC5661, but the NFSv4.1 server can handle this case without error. This patch changes the NFSv4.1 (and NFSv4.2) server to handle multiple uses of the same lock_owner in open_to_lock_owner so that it now correctly interoperates with the Linux NFS client. It also changes the error returned for NFSv4.0 to be NFSERR_BADSEQID. Thanks go to Bjorn for diagnosing this and testing the patch. He also provided a program that I could use to reproduce the problem. PR: 249567 Reported by: bf@cebitec.uni-bielefeld.de Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Tue Sep 29 01:56:21 2020 (r366240) +++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Tue Sep 29 02:03:24 2020 (r366241) @@ -1799,14 +1799,20 @@ tryagain: } if (!error) nfsrv_getowner(&stp->ls_open, new_stp, &lckstp); - if (lckstp) + if (lckstp) { /* - * I believe this should be an error, but it - * isn't obvious what NFSERR_xxx would be - * appropriate, so I'll use NFSERR_INVAL for now. + * For NFSv4.1 and NFSv4.2 allow an + * open_to_lock_owner when the lock_owner already + * exists. Just clear NFSLCK_OPENTOLOCK so that + * a new lock_owner will not be created. + * RFC7530 states that the error for NFSv4.0 + * is NFS4ERR_BAD_SEQID. */ - error = NFSERR_INVAL; - else + if ((nd->nd_flag & ND_NFSV41) != 0) + new_stp->ls_flags &= ~NFSLCK_OPENTOLOCK; + else + error = NFSERR_BADSEQID; + } else lckstp = new_stp; } else if (new_stp->ls_flags&(NFSLCK_LOCK|NFSLCK_UNLOCK)) { /* From owner-svn-src-stable-11@freebsd.org Tue Sep 29 15:37:58 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7D294269EB; Tue, 29 Sep 2020 15:37:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C13S65jrQz3T7b; Tue, 29 Sep 2020 15:37:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7718109FB; Tue, 29 Sep 2020 15:37:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TFbwLu088010; Tue, 29 Sep 2020 15:37:58 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TFbwMk087990; Tue, 29 Sep 2020 15:37:58 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202009291537.08TFbwMk087990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Tue, 29 Sep 2020 15:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366259 - in stable/11/usr.sbin: bsdconfig/share/media bsdinstall/scripts X-SVN-Group: stable-11 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in stable/11/usr.sbin: bsdconfig/share/media bsdinstall/scripts X-SVN-Commit-Revision: 366259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 15:37:59 -0000 Author: zeising (doc,ports committer) Date: Tue Sep 29 15:37:57 2020 New Revision: 366259 URL: https://svnweb.freebsd.org/changeset/base/366259 Log: MFC r366186: bsdconfig, bsdinstall: Prune dead mirrors Prune dead mirrors from the list of mirrors in bsdconfig and bsdinstall. All these return NXDOMAIN when trying to resolve them. Approved by: emaste Modified: stable/11/usr.sbin/bsdconfig/share/media/ftp.subr stable/11/usr.sbin/bsdinstall/scripts/mirrorselect Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- stable/11/usr.sbin/bsdconfig/share/media/ftp.subr Tue Sep 29 15:37:33 2020 (r366258) +++ stable/11/usr.sbin/bsdconfig/share/media/ftp.subr Tue Sep 29 15:37:57 2020 (r366259) @@ -82,7 +82,6 @@ f_dialog_menu_media_ftp() ' IPv6 $msg_japan' 'ftp2.jp.freebsd.org' ' IPv6 $msg_sweden' 'ftp4.se.freebsd.org' ' IPv6 $msg_usa' 'ftp4.us.freebsd.org' - ' IPv6 $msg_turkey' 'ftp2.tr.freebsd.org' '$msg_primary' 'ftp1.freebsd.org' ' $msg_primary #2' 'ftp2.freebsd.org' ' $msg_primary #3' 'ftp3.freebsd.org' @@ -95,7 +94,6 @@ f_dialog_menu_media_ftp() ' $msg_primary #12' 'ftp12.freebsd.org' ' $msg_primary #13' 'ftp13.freebsd.org' ' $msg_primary #14' 'ftp14.freebsd.org' - '$msg_armenia' 'ftp1.am.freebsd.org' '$msg_australia' 'ftp.au.freebsd.org' ' $msg_australia #2' 'ftp2.au.freebsd.org' ' $msg_australia #3' 'ftp3.au.freebsd.org' @@ -103,11 +101,9 @@ f_dialog_menu_media_ftp() '$msg_brazil' 'ftp2.br.freebsd.org' ' $msg_brazil #3' 'ftp3.br.freebsd.org' ' $msg_brazil #4' 'ftp4.br.freebsd.org' - '$msg_canada' 'ftp.ca.freebsd.org' '$msg_china' 'ftp.cn.freebsd.org' '$msg_czech_republic' 'ftp.cz.freebsd.org' '$msg_denmark' 'ftp.dk.freebsd.org' - '$msg_estonia' 'ftp.ee.freebsd.org' '$msg_finland' 'ftp.fi.freebsd.org' '$msg_france' 'ftp.fr.freebsd.org' ' $msg_france #3' 'ftp3.fr.freebsd.org' @@ -120,13 +116,11 @@ f_dialog_menu_media_ftp() ' $msg_germany #2' 'ftp2.de.freebsd.org' ' $msg_germany #4' 'ftp4.de.freebsd.org' ' $msg_germany #5' 'ftp5.de.freebsd.org' - ' $msg_germany #6' 'ftp6.de.freebsd.org' ' $msg_germany #7' 'ftp7.de.freebsd.org' ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' '$msg_ireland' 'ftp3.ie.freebsd.org' - '$msg_israel' 'ftp.il.freebsd.org' '$msg_japan' 'ftp.jp.freebsd.org' ' $msg_japan #2' 'ftp2.jp.freebsd.org' ' $msg_japan #3' 'ftp3.jp.freebsd.org' @@ -139,16 +133,13 @@ f_dialog_menu_media_ftp() '$msg_korea' 'ftp.kr.freebsd.org' ' $msg_korea #2' 'ftp2.kr.freebsd.org' '$msg_latvia' 'ftp.lv.freebsd.org' - '$msg_lithuania' 'ftp.lt.freebsd.org' '$msg_netherlands' 'ftp.nl.freebsd.org' ' $msg_netherlands #2' 'ftp2.nl.freebsd.org' '$msg_new_zealand' 'ftp.nz.freebsd.org' '$msg_norway' 'ftp.no.freebsd.org' '$msg_poland' 'ftp.pl.freebsd.org' - ' $msg_poland #2' 'ftp2.pl.freebsd.org' '$msg_russia' 'ftp.ru.freebsd.org' ' $msg_russia #2' 'ftp2.ru.freebsd.org' - ' $msg_russia #4' 'ftp4.ru.freebsd.org' ' $msg_russia #5' 'ftp5.ru.freebsd.org' ' $msg_russia #6' 'ftp6.ru.freebsd.org' '$msg_slovak_republic' 'ftp.sk.freebsd.org' @@ -157,13 +148,9 @@ f_dialog_menu_media_ftp() '$msg_south_africa' 'ftp.za.freebsd.org' ' $msg_south_africa #2' 'ftp2.za.freebsd.org' ' $msg_south_africa #4' 'ftp4.za.freebsd.org' - '$msg_spain' 'ftp.es.freebsd.org' - ' $msg_spain #3' 'ftp3.es.freebsd.org' '$msg_sweden' 'ftp.se.freebsd.org' ' $msg_sweden #2' 'ftp2.se.freebsd.org' - ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' - ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' ' $msg_taiwan #2' 'ftp2.tw.freebsd.org' Modified: stable/11/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/mirrorselect Tue Sep 29 15:37:33 2020 (r366258) +++ stable/11/usr.sbin/bsdinstall/scripts/mirrorselect Tue Sep 29 15:37:57 2020 (r366259) @@ -44,7 +44,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ ftp://ftp4.us.freebsd.org "IPv6 USA"\ - ftp://ftp2.tr.freebsd.org "IPv6 Turkey"\ ftp://ftp1.freebsd.org "Primary"\ ftp://ftp2.freebsd.org "Primary #2"\ ftp://ftp3.freebsd.org "Primary #3"\ @@ -57,7 +56,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp12.freebsd.org "Primary #12"\ ftp://ftp13.freebsd.org "Primary #13"\ ftp://ftp14.freebsd.org "Primary #14"\ - ftp://ftp1.am.freebsd.org "Armenia"\ ftp://ftp.au.freebsd.org "Australia"\ ftp://ftp2.au.freebsd.org "Australia #2"\ ftp://ftp3.au.freebsd.org "Australia #3"\ @@ -65,11 +63,9 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.br.freebsd.org "Brazil #2"\ ftp://ftp3.br.freebsd.org "Brazil #3"\ ftp://ftp4.br.freebsd.org "Brazil #4"\ - ftp://ftp.ca.freebsd.org "Canada"\ ftp://ftp.cn.freebsd.org "China"\ ftp://ftp.cz.freebsd.org "Czech Republic"\ ftp://ftp.dk.freebsd.org "Denmark"\ - ftp://ftp.ee.freebsd.org "Estonia"\ ftp://ftp.fi.freebsd.org "Finland"\ ftp://ftp.fr.freebsd.org "France"\ ftp://ftp3.fr.freebsd.org "France #3"\ @@ -82,13 +78,11 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.de.freebsd.org "Germany #2"\ ftp://ftp4.de.freebsd.org "Germany #4"\ ftp://ftp5.de.freebsd.org "Germany #5"\ - ftp://ftp6.de.freebsd.org "Germany #6"\ ftp://ftp7.de.freebsd.org "Germany #7"\ ftp://ftp8.de.freebsd.org "Germany #8"\ ftp://ftp.gr.freebsd.org "Greece"\ ftp://ftp2.gr.freebsd.org "Greece #2"\ ftp://ftp3.ie.freebsd.org "Ireland #3"\ - ftp://ftp.il.freebsd.org "Israel"\ ftp://ftp.jp.freebsd.org "Japan"\ ftp://ftp2.jp.freebsd.org "Japan #2"\ ftp://ftp3.jp.freebsd.org "Japan #3"\ @@ -101,16 +95,13 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp.kr.freebsd.org "Korea"\ ftp://ftp2.kr.freebsd.org "Korea #2"\ ftp://ftp.lv.freebsd.org "Latvia"\ - ftp://ftp.lt.freebsd.org "Lithuania"\ ftp://ftp.nl.freebsd.org "Netherlands"\ ftp://ftp2.nl.freebsd.org "Netherlands #2"\ ftp://ftp.nz.freebsd.org "New Zealand"\ ftp://ftp.no.freebsd.org "Norway"\ ftp://ftp.pl.freebsd.org "Poland"\ - ftp://ftp2.pl.freebsd.org "Poland #2"\ ftp://ftp.ru.freebsd.org "Russia"\ ftp://ftp2.ru.freebsd.org "Russia #2"\ - ftp://ftp4.ru.freebsd.org "Russia #4"\ ftp://ftp5.ru.freebsd.org "Russia #5"\ ftp://ftp6.ru.freebsd.org "Russia #6"\ ftp://ftp.sk.freebsd.org "Slovak Republic"\ @@ -119,13 +110,8 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp.za.freebsd.org "South Africa"\ ftp://ftp2.za.freebsd.org "South Africa #2"\ ftp://ftp4.za.freebsd.org "South Africa #4"\ - ftp://ftp.es.freebsd.org "Spain"\ - ftp://ftp3.es.freebsd.org "Spain #3"\ ftp://ftp.se.freebsd.org "Sweden"\ - ftp://ftp2.se.freebsd.org "Sweden #2"\ - ftp://ftp3.se.freebsd.org "Sweden #3"\ ftp://ftp4.se.freebsd.org "Sweden #4"\ - ftp://ftp6.se.freebsd.org "Sweden #6"\ ftp://ftp.ch.freebsd.org "Switzerland"\ ftp://ftp.tw.freebsd.org "Taiwan"\ ftp://ftp2.tw.freebsd.org "Taiwan #2"\ From owner-svn-src-stable-11@freebsd.org Wed Sep 30 02:28:48 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B04D3F89AE; Wed, 30 Sep 2020 02:28:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Kv40L9Tz4Yvy; Wed, 30 Sep 2020 02:28:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2EEE18556; Wed, 30 Sep 2020 02:28:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U2SlFN001208; Wed, 30 Sep 2020 02:28:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U2Sk8w001202; Wed, 30 Sep 2020 02:28:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009300228.08U2Sk8w001202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Sep 2020 02:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366281 - in stable/11/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Commit-Revision: 366281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 02:28:48 -0000 Author: kib Date: Wed Sep 30 02:28:46 2020 New Revision: 366281 URL: https://svnweb.freebsd.org/changeset/base/366281 Log: MFC r366085, r366113: Do not leak oldvmspace if image activation failed Modified: stable/11/sys/compat/cloudabi/cloudabi_proc.c stable/11/sys/compat/freebsd32/freebsd32_misc.c stable/11/sys/compat/linux/linux_emul.c stable/11/sys/kern/kern_exec.c stable/11/sys/sys/imgact.h stable/11/sys/sys/syscallsubr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/cloudabi/cloudabi_proc.c ============================================================================== --- stable/11/sys/compat/cloudabi/cloudabi_proc.c Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/compat/cloudabi/cloudabi_proc.c Wed Sep 30 02:28:46 2020 (r366281) @@ -57,7 +57,7 @@ cloudabi_sys_proc_exec(struct thread *td, uap->fds, uap->fds_len); if (error == 0) { args.fd = uap->fd; - error = kern_execve(td, &args, NULL); + error = kern_execve(td, &args, NULL, oldvmspace); } post_execve(td, error, oldvmspace); return (error); Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 30 02:28:46 2020 (r366281) @@ -428,7 +428,7 @@ freebsd32_execve(struct thread *td, struct freebsd32_e error = freebsd32_exec_copyin_args(&eargs, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } @@ -447,7 +447,7 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_ uap->argv, uap->envv); if (error == 0) { eargs.fd = uap->fd; - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); } post_execve(td, error, oldvmspace); return (error); Modified: stable/11/sys/compat/linux/linux_emul.c ============================================================================== --- stable/11/sys/compat/linux/linux_emul.c Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/compat/linux/linux_emul.c Wed Sep 30 02:28:46 2020 (r366281) @@ -226,7 +226,7 @@ linux_common_execve(struct thread *td, struct image_ar if (error != 0) return (error); - error = kern_execve(td, eargs, NULL); + error = kern_execve(td, eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); if (error != 0) return (error); Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/kern/kern_exec.c Wed Sep 30 02:28:46 2020 (r366281) @@ -117,7 +117,7 @@ static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS) static int sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS); static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS); static int do_execve(struct thread *td, struct image_args *args, - struct mac *mac_p); + struct mac *mac_p, struct vmspace *oldvmspace); /* XXX This should be vm_size_t. */ SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD| @@ -220,7 +220,7 @@ sys_execve(struct thread *td, struct execve_args *uap) error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) - error = kern_execve(td, &args, NULL); + error = kern_execve(td, &args, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } @@ -246,7 +246,7 @@ sys_fexecve(struct thread *td, struct fexecve_args *ua uap->argv, uap->envv); if (error == 0) { args.fd = uap->fd; - error = kern_execve(td, &args, NULL); + error = kern_execve(td, &args, NULL, oldvmspace); } post_execve(td, error, oldvmspace); return (error); @@ -275,7 +275,7 @@ sys___mac_execve(struct thread *td, struct __mac_execv error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) - error = kern_execve(td, &args, uap->mac_p); + error = kern_execve(td, &args, uap->mac_p, oldvmspace); post_execve(td, error, oldvmspace); return (error); #else @@ -323,30 +323,26 @@ post_execve(struct thread *td, int error, struct vmspa thread_single_end(p, SINGLE_BOUNDARY); PROC_UNLOCK(p); } - if ((td->td_pflags & TDP_EXECVMSPC) != 0) { - KASSERT(p->p_vmspace != oldvmspace, - ("oldvmspace still used")); - vmspace_free(oldvmspace); - td->td_pflags &= ~TDP_EXECVMSPC; - } + exec_cleanup(td, oldvmspace); } /* - * XXX: kern_execve has the astonishing property of not always returning to + * kern_execve() has the astonishing property of not always returning to * the caller. If sufficiently bad things happen during the call to * do_execve(), it can end up calling exit1(); as a result, callers must * avoid doing anything which they might need to undo (e.g., allocating * memory). */ int -kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p) +kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p, + struct vmspace *oldvmspace) { AUDIT_ARG_ARGV(args->begin_argv, args->argc, args->begin_envv - args->begin_argv); AUDIT_ARG_ENVV(args->begin_envv, args->envc, args->endp - args->begin_envv); - return (do_execve(td, args, mac_p)); + return (do_execve(td, args, mac_p, oldvmspace)); } /* @@ -354,7 +350,8 @@ kern_execve(struct thread *td, struct image_args *args * userspace pointers from the passed thread. */ static int -do_execve(struct thread *td, struct image_args *args, struct mac *mac_p) +do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, + struct vmspace *oldvmspace) { struct proc *p = td->td_proc; struct nameidata nd; @@ -966,6 +963,7 @@ exec_fail: if (error && imgp->vmspace_destroyed) { /* sorry, no more process anymore. exit gracefully */ + exec_cleanup(td, oldvmspace); exit1(td, 0, SIGABRT); /* NOT REACHED */ } @@ -976,6 +974,17 @@ exec_fail: #endif return (error); +} + +void +exec_cleanup(struct thread *td, struct vmspace *oldvmspace) +{ + if ((td->td_pflags & TDP_EXECVMSPC) != 0) { + KASSERT(td->td_proc->p_vmspace != oldvmspace, + ("oldvmspace still used")); + vmspace_free(oldvmspace); + td->td_pflags &= ~TDP_EXECVMSPC; + } } int Modified: stable/11/sys/sys/imgact.h ============================================================================== --- stable/11/sys/sys/imgact.h Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/sys/imgact.h Wed Sep 30 02:28:46 2020 (r366281) @@ -97,6 +97,7 @@ struct vmspace; int exec_alloc_args(struct image_args *); int exec_check_permissions(struct image_params *); +void exec_cleanup(struct thread *td, struct vmspace *); register_t *exec_copyout_strings(struct image_params *); void exec_free_args(struct image_args *); int exec_new_vmspace(struct image_params *, struct sysentvec *); Modified: stable/11/sys/sys/syscallsubr.h ============================================================================== --- stable/11/sys/sys/syscallsubr.h Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/sys/syscallsubr.h Wed Sep 30 02:28:46 2020 (r366281) @@ -59,6 +59,7 @@ struct stat; struct thr_param; struct sched_param; struct __wrusage; +struct vmspace; typedef int (*mmap_check_fp_fn)(struct file *, int, int, int); @@ -103,7 +104,7 @@ int kern_cpuset_setid(struct thread *td, cpuwhich_t wh id_t id, cpusetid_t setid); int kern_dup(struct thread *td, u_int mode, int flags, int old, int new); int kern_execve(struct thread *td, struct image_args *args, - struct mac *mac_p); + struct mac *mac_p, struct vmspace *oldvmspace); int kern_fchmodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, mode_t mode, int flag); int kern_fchownat(struct thread *td, int fd, char *path, From owner-svn-src-stable-11@freebsd.org Wed Sep 30 03:38:14 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31B423F9BBF; Wed, 30 Sep 2020 03:38:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1MR96NtSz4dFr; Wed, 30 Sep 2020 03:38:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFBD91973A; Wed, 30 Sep 2020 03:38:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U3cDnX045735; Wed, 30 Sep 2020 03:38:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U3cD9v045734; Wed, 30 Sep 2020 03:38:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202009300338.08U3cD9v045734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Sep 2020 03:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366282 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 366282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 03:38:14 -0000 Author: cy Date: Wed Sep 30 03:38:13 2020 New Revision: 366282 URL: https://svnweb.freebsd.org/changeset/base/366282 Log: MFC r366204: Remove extraneous bracket. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Wed Sep 30 02:28:46 2020 (r366281) +++ stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Wed Sep 30 03:38:13 2020 (r366282) @@ -13,7 +13,7 @@ #define __IP_PROXY_H__ #ifndef SOLARIS -# if defined(sun) && defined(__SVR4)) +# if defined(sun) && defined(__SVR4) # define SOLARIS 1 # else # define SOLARIS 0 From owner-svn-src-stable-11@freebsd.org Wed Sep 30 12:16:36 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB1E5426DFD; Wed, 30 Sep 2020 12:16:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1ZxJ5Qqzz4DT1; Wed, 30 Sep 2020 12:16:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 996901F82A; Wed, 30 Sep 2020 12:16:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UCGaw8068766; Wed, 30 Sep 2020 12:16:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UCGa6m068765; Wed, 30 Sep 2020 12:16:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009301216.08UCGa6m068765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Sep 2020 12:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366288 - stable/11/sys/compat/svr4 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/compat/svr4 X-SVN-Commit-Revision: 366288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 12:16:36 -0000 Author: kib Date: Wed Sep 30 12:16:36 2020 New Revision: 366288 URL: https://svnweb.freebsd.org/changeset/base/366288 Log: Try to fix build on i386 Modified: stable/11/sys/compat/svr4/svr4_misc.c Modified: stable/11/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/11/sys/compat/svr4/svr4_misc.c Wed Sep 30 08:26:25 2020 (r366287) +++ stable/11/sys/compat/svr4/svr4_misc.c Wed Sep 30 12:16:36 2020 (r366288) @@ -180,7 +180,7 @@ svr4_sys_execv(td, uap) error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, NULL); free(path, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } @@ -206,7 +206,7 @@ svr4_sys_execve(td, uap) uap->envp); free(path, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } From owner-svn-src-stable-11@freebsd.org Wed Sep 30 18:09:52 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DC8B42D54B; Wed, 30 Sep 2020 18:09:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1kmv6XPnz4bMx; Wed, 30 Sep 2020 18:09:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF53823922; Wed, 30 Sep 2020 18:09:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UI9p9Z088313; Wed, 30 Sep 2020 18:09:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UI9p9r088312; Wed, 30 Sep 2020 18:09:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009301809.08UI9p9r088312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 30 Sep 2020 18:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366297 - in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Commit-Revision: 366297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 18:09:52 -0000 Author: jhb Date: Wed Sep 30 18:09:50 2020 New Revision: 366297 URL: https://svnweb.freebsd.org/changeset/base/366297 Log: MFC 366175: Revert most of r360179. I had failed to notice that sgsendccb() was using cam_periph_mapmem() and thus was not passing down user pointers directly to drivers. In practice this broke requests submitted from userland. PR: 249395 Modified: stable/11/sys/cam/scsi/scsi_sg.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/cam/scsi/scsi_sg.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_sg.c Wed Sep 30 17:49:06 2020 (r366296) +++ stable/11/sys/cam/scsi/scsi_sg.c Wed Sep 30 18:09:50 2020 (r366297) @@ -506,7 +506,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int struct cam_periph *periph; struct sg_softc *softc; struct sg_io_hdr *req; - void *data_ptr; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -551,20 +550,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } - if (req->dxfer_len > MAXPHYS) { - error = EINVAL; - break; - } - - data_ptr = malloc(req->dxfer_len, M_DEVBUF, M_WAITOK); - ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, req->cmd_len); if (error) { - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -585,21 +576,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } - if (dir == CAM_DIR_IN || dir == CAM_DIR_BOTH) { - error = copyin(req->dxferp, data_ptr, req->dxfer_len); - if (error) { - free(data_ptr, M_DEVBUF); - xpt_release_ccb(ccb); - break; - } - } - cam_fill_csio(csio, /*retries*/1, sgdone, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - data_ptr, + req->dxferp, req->dxfer_len, req->mx_sb_len, req->cmd_len, @@ -609,7 +591,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int if (error) { req->host_status = DID_ERROR; req->driver_status = DRIVER_INVALID; - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -628,10 +609,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int req->sb_len_wr); } - if ((dir == CAM_DIR_OUT || dir == CAM_DIR_BOTH) && error == 0) - error = copyout(data_ptr, req->dxferp, req->dxfer_len); - - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; From owner-svn-src-stable-11@freebsd.org Thu Oct 1 03:10:43 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91AF33F068B; Thu, 1 Oct 2020 03:10:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1ymz3PDMz47kR; Thu, 1 Oct 2020 03:10:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5825CA346; Thu, 1 Oct 2020 03:10:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0913Ahbc025944; Thu, 1 Oct 2020 03:10:43 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0913AhUh025943; Thu, 1 Oct 2020 03:10:43 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010010310.0913AhUh025943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 1 Oct 2020 03:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366306 - stable/11/sbin/fsck_msdosfs X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/fsck_msdosfs X-SVN-Commit-Revision: 366306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 03:10:43 -0000 Author: delphij Date: Thu Oct 1 03:10:42 2020 New Revision: 366306 URL: https://svnweb.freebsd.org/changeset/base/366306 Log: MFC r366064, r366065, r366215: sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms Modified: stable/11/sbin/fsck_msdosfs/dir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_msdosfs/dir.c ============================================================================== --- stable/11/sbin/fsck_msdosfs/dir.c Thu Oct 1 03:08:23 2020 (r366305) +++ stable/11/sbin/fsck_msdosfs/dir.c Thu Oct 1 03:10:42 2020 (r366306) @@ -388,7 +388,8 @@ static int checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir) { int ret = FSOK; - size_t physicalSize; + size_t chainsize; + u_int64_t physicalSize; struct bootblock *boot; boot = fat_get_boot(fat); @@ -401,9 +402,9 @@ checksize(struct fat_descriptor *fat, u_char *p, struc } else { if (!fat_is_valid_cl(fat, dir->head)) return FSERROR; - ret = checkchain(fat, dir->head, &physicalSize); + ret = checkchain(fat, dir->head, &chainsize); /* - * Upon return, physicalSize would hold the chain length + * Upon return, chainsize would hold the chain length * that checkchain() was able to validate, but if the user * refused the proposed repair, it would be unsafe to * proceed with directory entry fix, so bail out in that @@ -412,11 +413,17 @@ checksize(struct fat_descriptor *fat, u_char *p, struc if (ret == FSERROR) { return (FSERROR); } - physicalSize *= boot->ClusterSize; + /* + * The maximum file size on FAT32 is 4GiB - 1, which + * will occupy a cluster chain of exactly 4GiB in + * size. On 32-bit platforms, since size_t is 32-bit, + * it would wrap back to 0. + */ + physicalSize = (u_int64_t)chainsize * boot->ClusterSize; } if (physicalSize < dir->size) { - pwarn("size of %s is %u, should at most be %zu\n", - fullpath(dir), dir->size, physicalSize); + pwarn("size of %s is %u, should at most be %ju\n", + fullpath(dir), dir->size, (uintmax_t)physicalSize); if (ask(1, "Truncate")) { dir->size = physicalSize; p[28] = (u_char)physicalSize;