Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp971551rdb; Wed, 24 Jan 2024 00:13:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtXwZ9nDaRn/FIqYKlj7Hd2fCbaelcr9VdWgbFCvM6ofhFtwlx6WvDD+JrL4UkJv0pA/ts X-Received: by 2002:a17:90a:5916:b0:28e:7af9:80ae with SMTP id k22-20020a17090a591600b0028e7af980aemr2996253pji.76.1706083989029; Wed, 24 Jan 2024 00:13:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706083989; cv=pass; d=google.com; s=arc-20160816; b=UKH7XpDgWajObr8A1RNrwUiJhZ+d4yrRldwCWIHhGr+nOpZUPxzyqtGjqwxfs/+C1A W5HP/F2h0sJdabHriU51Qd02qlXSKgCuQMQtmgeaxqo2PvoQR5wSvP66vfk09MfcDA0C dM9pTx+0VyTh/7tdSMeYfk3dMGmBP/GKYUxu4WwvZ2EdcboenMdKOLoZahKZe4Y6bT5a x03VUUccIx4OWqdbGK49QbiJYotUiEDqWifevXLjmNZxAQYMtlxpGayUhiAka9Ykjxox EiVgRU9drMJ5hg7l2otkx4pw7y0SBoWnbi8k6WPFojDo8BttRnX1OJiDPhPjCabeNCYK maJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=ZwuSM4ZywORUMVxFPkG3MmUndAlpqgqOEw7Unxr8DYg=; fh=4Vodg6AF2Rwr/unxmWsjptdA/bXZQusni4geHSRGAQA=; b=Qsm70xMoykXWOI4y1EldkZ6NZv7WIgWzNAz/WXG15kateYaUyxwaKC4ykDjYsOxQ2i b+E7pRKIOgK8E78S8U8yHEOJNQcmJq6HIvgeKwZD+vg2Y+MpTMQxLHRHW0Dq8RzDAlSg 4zZ48PyekazXF/L3+DGvkqZdpOQQtLlUqRnHWGA2iCixrZfkzDtF8UL6FWVVsNpB3Bd7 yXKzUYqS5EOURrHCXU9sZFFNEl7NxgRhXYl73FLtMAhHHl6oDT0DpIQpoZcw9on8/B/t gdbVBcqS7AbW7puS/79IBLPuM0wITmTfdejNDZsHpfIZm/63mYlBAg5MQNvzKwbHQ40J FL0A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=P2Hc2rt+; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=C4r5lcFi; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-36598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v12-20020a1709029a0c00b001d7711d26c2si2119515plp.157.2024.01.24.00.13.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 00:13:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=P2Hc2rt+; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=C4r5lcFi; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-36598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CC812B261D5 for ; Wed, 24 Jan 2024 07:57:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC03D171C9; Wed, 24 Jan 2024 07:57:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="P2Hc2rt+"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="C4r5lcFi" Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 231FC5C85; Wed, 24 Jan 2024 07:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706083037; cv=none; b=lyZfpuJqxVQCus8smxYN5/S2F5P9E2TF9U2mBvvoV/+7xHR1VVtIh8j1Zn6ofJisGdnlP6+OiZ6AunfDyuHGRgIJAewOSFjLTgsb+K/jrNJ4UcwQsNu87Sfwlm1uVKJUfKgaaIxSvut1yztzNc2ABEZRXxTkCxwIHR4lo9WRk6w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706083037; c=relaxed/simple; bh=H1RgzITUOCuBAmiNIP/bkdVi51TkAA5ExJr5YGT+qz0=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=QkJA9u3Som96c0rGjWYavizKqujjQTVlSuo7N4F0hNE5kAaaWwI7cLEA3rXRWRMLrpojKTjfAKNvsqRYU05TmyldajAOTRZ3WmUPpKiNfFK2u1Kf7DAkvBQfE0rHOc4kEaqJRyLBSexyTv6PNuKijE9SypqXZbb9uIeb9jcIw0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=P2Hc2rt+; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=C4r5lcFi; arc=none smtp.client-ip=64.147.123.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 9BE6F3200A35; Wed, 24 Jan 2024 02:57:14 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Wed, 24 Jan 2024 02:57:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1706083034; x=1706169434; bh=ZwuSM4ZywO RUMVxFPkG3MmUndAlpqgqOEw7Unxr8DYg=; b=P2Hc2rt+q2/08jOIIXFAlF7a/X yft+6VFlCEWhY36dgDfZ3f96tY0QDNLsEu3uQZ2PY0HP1CG2XE8U25iqyopvlUuZ Rcp/B4YlIxjJqQM2nX1AK/E7Ft2ii7gsQ0IrHS/qWPLmGzHFoYz8pPozzdYI3FQq hf6JUtWfayV+hPYB/xmbKcq4/EcrcbNGfUs4L8pk8ZgEbPki8KZJGDDxOp6vSy/v X9b7lKIEQQjtF4IYyqVpBKoQkX2p2D51K+nSC1rC72v3+BsrlsAVu119HsNzlAA5 oMSQtZ6dzwWbVDCBGxVlpeHs9SNtBWkunvQ9fo3EdinX514WzKS9ovOddzoA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706083034; x=1706169434; bh=ZwuSM4ZywORUMVxFPkG3MmUndAlp qgqOEw7Unxr8DYg=; b=C4r5lcFink3F1aepdJCZCIZq39CNNE53jHzI2zoH45ug iTS2Df9Wb/qWJQiCo33AWL4Wba2Z0iNI5b0qEFaGYGzdE/t5QUT/OEx8J1nj4P8u GPaTTaWfm4cFQ/nebn2V+9xA5eR0iIQZKi/LNscyP1wXjuSwRg1k9KZN8vYNE9cI iEOi0zf0QjXgOWvJ+G14odfg/hXvx7nFnPcONqb3KyFbSaZ54EvLDbetU48xHu2M JJU4vgPNt1+GnRJn59EjOg2K5yQxhRvNfIaXVNlc63iRVS5sct9ZMUArcizbv1GI g6KQWhpodmFf3AVVdPE96CStr6E6qCFilmsCxrN6JQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeltddgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C7018B6008D; Wed, 24 Jan 2024 02:57:13 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-119-ga8b98d1bd8-fm-20240108.001-ga8b98d1b Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <18c814fa-b458-48f9-b7e8-88b23a1825e2@app.fastmail.com> In-Reply-To: <20240124004028.16826-6-zfigura@codeweavers.com> References: <20240124004028.16826-1-zfigura@codeweavers.com> <20240124004028.16826-6-zfigura@codeweavers.com> Date: Wed, 24 Jan 2024 08:56:52 +0100 From: "Arnd Bergmann" To: "Elizabeth Figura" , "Greg Kroah-Hartman" , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: wine-devel@winehq.org, =?UTF-8?Q?Andr=C3=A9_Almeida?= , "Wolfram Sang" , "Arkadiusz Hiler" , "Peter Zijlstra" Subject: Re: [RFC PATCH 5/9] ntsync: Introduce NTSYNC_IOC_WAIT_ANY. Content-Type: text/plain On Wed, Jan 24, 2024, at 01:40, Elizabeth Figura wrote: > + if (args->timeout) { > + struct timespec64 to; > + > + if (get_timespec64(&to, u64_to_user_ptr(args->timeout))) > + return -EFAULT; > + if (!timespec64_valid(&to)) > + return -EINVAL; > + > + timeout = timespec64_to_ns(&to); > + } Have you considered just passing the nanosecond value here? Since you do not appear to write it back, that would avoid the complexities of dealing with timespec layout differences and indirection. > + ids = kmalloc_array(count, sizeof(*ids), GFP_KERNEL); > + if (!ids) > + return -ENOMEM; > + if (copy_from_user(ids, u64_to_user_ptr(args->objs), > + array_size(count, sizeof(*ids)))) { > + kfree(ids); > + return -EFAULT; > + } This looks like memdup_user() would be slightly simpler. Arnd