From nobody Sat May 28 20:53:27 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6B96A1B505C9; Sat, 28 May 2022 20:53: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 4L9YmR5MV6z4lNv; Sat, 28 May 2022 20:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653771208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3g/bnAjAv/0LRo2nZK2Ks0ylIcEU8m8uUNjL355xJV8=; b=YcPxaVTKs7lA2xE1ptxQHAFbn7EHAtgum834dXP2SotVPCqikCTICBMA4aZiKYrYRcDgv6 UogsgWVp/RLH8/mcJkrG21bzIoMTfMZCKNHPzj3jbXit1xWKH3upU93IZBqIbUFCnp2elp H4r6i8Zdivm7jvm1qEYCNDoymTRRoHDPC1EqelYMu/i3L+yxOyoiQP8GQppMmHb9alV76K KtzoBw5BJbmSUq+eeaj3gG6Cg1k0Jv1ginFKen1+HUTFj5Bk6R0Awq1shtOkkwocl2TC2H KnNaG4BkvM3TajChzZoMwOzNebfuKVQCuOz7L2cdg0tpPnocq3Tf7aIb2WCxMg== 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 8AB3A16109; Sat, 28 May 2022 20: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 24SKrRfq099487; Sat, 28 May 2022 20: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 24SKrRfF099486; Sat, 28 May 2022 20:53:27 GMT (envelope-from git) Date: Sat, 28 May 2022 20:53:27 GMT Message-Id: <202205282053.24SKrRfF099486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 53494b918d63 - main - linux(4): Overwrite SO_TIMESTAMP counterpart List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53494b918d63a5b31793ce7f66569d4bd03f5817 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653771208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3g/bnAjAv/0LRo2nZK2Ks0ylIcEU8m8uUNjL355xJV8=; b=nUB8PhCnv3DRwdQdIenlqR0IUundUaOujXXSfW5TZSxTZotdMbecHl/nYTByQqqlF+GCJZ /sbzYVX5JMzHhd1HLs6edWPsFP89UpSTc9dPffNrPq0h+WEGLfqLkgF+dIU0+ovHFqMOKT 4WAf5zRv1tu0BfNQ4o36d14WYXFLmDwHHZAEwx6iTq7qE8rin22KK9OYmYN7kR4728Y/kb gvF3fQXz6svDmI7pE+ZBnaEkw2Jc1vyH4/gDvGarLBT54380lEHyl/dqwr/omBAesPqX4k 0LX2++XBzOL1rm3ZigmsnG6n9Fhby9YlaQEhSR2t+CMvdnsBL7ZOw9DrO9n3FA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653771208; a=rsa-sha256; cv=none; b=Bv9GtOycQKEWktx2Jnu/fHBYCGt3KmEtx6lYY0NtwWda9HoFdmuhIc2nmYwyqgGQb7mCld OhlbUEUGJPoAhdseo/iK51zwCLj6SEtxpsFUjN3hR5m8mu5q7/4aIeTEPt+JfNOB2pFBbP QSMq/r2V4QYM4w0fLHfH+xvZq59TrEY+pzZOF6KVdDpSuvsZ7H6nOM1FXdwJJwSapxMLVd ie+6CoBTmciWUOQOmPG5qmPLwZ51swvoxgJZagIWX+PT7X506o7sRbnVX3yT1wdsQkDOdr PCYPskl/Gw/rXAhF+WD8HMu/KbzXZz7XjkDE+wD3j3H9Zr7VEXEM5Rdgdd+/Iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=53494b918d63a5b31793ce7f66569d4bd03f5817 commit 53494b918d63a5b31793ce7f66569d4bd03f5817 Author: Dmitry Chagin AuthorDate: 2022-05-28 20:46:38 +0000 Commit: Dmitry Chagin CommitDate: 2022-05-28 20:46:38 +0000 linux(4): Overwrite SO_TIMESTAMP counterpart A socket cannot mix SO_TIMESTAMP and SO_TIMESTAMPNS: the two modes are mutually exclusive. MFC after: 2 weeks --- sys/compat/linux/linux_socket.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 401e1bc5c88f..3fea532d676d 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1984,7 +1984,7 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) struct sockaddr *sa; struct timeval tv; socklen_t len; - int error, level, name; + int error, level, name, val; level = linux_to_bsd_sockopt_level(args->level); switch (level) { @@ -2007,10 +2007,22 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) name, &tv, UIO_SYSSPACE, sizeof(tv))); /* NOTREACHED */ case SO_TIMESTAMP: + /* overwrite SO_BINTIME */ + val = 0; + error = kern_setsockopt(td, args->s, level, + SO_BINTIME, &val, UIO_SYSSPACE, sizeof(val)); + if (error != 0) + return (error); pem = pem_find(p); pem->so_timestamp = args->optname; break; case SO_BINTIME: + /* overwrite SO_TIMESTAMP */ + val = 0; + error = kern_setsockopt(td, args->s, level, + SO_TIMESTAMP, &val, UIO_SYSSPACE, sizeof(val)); + if (error != 0) + return (error); pem = pem_find(p); pem->so_timestampns = args->optname; break;