From owner-svn-src-all@freebsd.org Mon Jan 13 21:12:11 2020 Return-Path: Delivered-To: svn-src-all@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 8D8FB1ED102; Mon, 13 Jan 2020 21:12:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xR9l3HyJz4BxJ; Mon, 13 Jan 2020 21:12:11 +0000 (UTC) (envelope-from glebius@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 6C5E8ACCA; Mon, 13 Jan 2020 21:12:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DLCBdt015121; Mon, 13 Jan 2020 21:12:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DLCBPX015120; Mon, 13 Jan 2020 21:12:11 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001132112.00DLCBPX015120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 13 Jan 2020 21:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356702 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 21:12:11 -0000 Author: glebius Date: Mon Jan 13 21:12:10 2020 New Revision: 356702 URL: https://svnweb.freebsd.org/changeset/base/356702 Log: Fix yet another regression from r354484. Error code from cr_cansee() aliases with hard error from other operations. Reported by: flo Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Jan 13 20:31:10 2020 (r356701) +++ head/sys/netinet/tcp_subr.c Mon Jan 13 21:12:10 2020 (r356702) @@ -2263,6 +2263,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) inp = CK_LIST_NEXT(inp, inp_list)) { INP_RLOCK(inp); if (inp->inp_gencnt <= xig.xig_gen) { + int crerr; + /* * XXX: This use of cr_cansee(), introduced with * TCP state changes, is not quite right, but for @@ -2270,13 +2272,13 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) */ if (inp->inp_flags & INP_TIMEWAIT) { if (intotw(inp) != NULL) - error = cr_cansee(req->td->td_ucred, + crerr = cr_cansee(req->td->td_ucred, intotw(inp)->tw_cred); else - error = EINVAL; /* Skip this inp. */ + crerr = EINVAL; /* Skip this inp. */ } else - error = cr_canseeinpcb(req->td->td_ucred, inp); - if (error == 0) { + crerr = cr_canseeinpcb(req->td->td_ucred, inp); + if (crerr == 0) { struct xtcpcb xt; tcp_inptoxtp(inp, &xt);