From owner-svn-src-all@freebsd.org Fri Oct 30 19:03:00 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 74F0C4593E4; Fri, 30 Oct 2020 19:03:00 +0000 (UTC) (envelope-from cem@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 4CNBXN2XBmz4N5C; Fri, 30 Oct 2020 19:03:00 +0000 (UTC) (envelope-from cem@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 3A1361B544; Fri, 30 Oct 2020 19:03:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09UJ30op045918; Fri, 30 Oct 2020 19:03:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09UJ30in045913; Fri, 30 Oct 2020 19:03:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202010301903.09UJ30in045913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 30 Oct 2020 19:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367182 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 367182 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.33 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: Fri, 30 Oct 2020 19:03:00 -0000 Author: cem Date: Fri Oct 30 19:02:59 2020 New Revision: 367182 URL: https://svnweb.freebsd.org/changeset/base/367182 Log: linux(4): Quiesce warning about madvise(..., -1) This API misuse is intended to produce an error value to detect certain bogus stub implementations of MADV_WIPEONFORK. We don't need to log a warning about it. Example: https://boringssl.googlesource.com/boringssl/+/ad5582985cc6b89d0e7caf0d9cc7e301de61cf66%5E%21/ Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D27017 Modified: head/sys/compat/linux/linux_mmap.c Modified: head/sys/compat/linux/linux_mmap.c ============================================================================== --- head/sys/compat/linux/linux_mmap.c Fri Oct 30 19:00:42 2020 (r367181) +++ head/sys/compat/linux/linux_mmap.c Fri Oct 30 19:02:59 2020 (r367182) @@ -394,6 +394,16 @@ linux_madvise_common(struct thread *td, uintptr_t addr case LINUX_MADV_SOFT_OFFLINE: linux_msg(curthread, "unsupported madvise MADV_SOFT_OFFLINE"); return (EINVAL); + case -1: + /* + * -1 is sometimes used as a dummy value to detect simplistic + * madvise(2) stub implementations. This safeguard is used by + * BoringSSL, for example, before assuming MADV_WIPEONFORK is + * safe to use. Don't produce an "unsupported" error message + * for this special dummy value, which is unlikely to be used + * by any new advisory behavior feature. + */ + return (EINVAL); default: linux_msg(curthread, "unsupported madvise behav %d", behav); return (EINVAL);