From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6EFD5EDA698 for ; Tue, 3 Mar 2026 17:05:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D195E10E88D; Tue, 3 Mar 2026 17:05:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="RbcyZ+x8"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 50E9B10E88D for ; Tue, 3 Mar 2026 17:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1772557512; x=1804093512; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=oZES0lo/XoGNlPs+hgZ8glezJ/Np7hw3CGTFFS3CGx0=; b=RbcyZ+x8G28bKCHp1hTUP1c4q0sPtk8PTMHgkuISXEi70yLbbG/Y686k PYSIwO/D3ldc0/SqBvdRHLLpLmA+ofoWg1vf+JFt/EnpkjaI0OKIwrBgI URBuI3tjRPU+ajcu7OxHevEdcNcb7ya8yF/gBPhImbNSRHzMOsIpZbY6e SfKDDoLB8S5J0e1GfdUx7wV2JGlwKa45ggrLpt0/FnNZzbiMUHSOSZR9W l7osW3wN/u0HYfxXIlYDxN9TLYP6tjSwagJ9VHtFmIxiGr2AbByuu2vno eEUkhB2JEPu4rryt9zweafdcQyiyPh4Ic8w0NYDYsn58o83IbP9vxSsQy A==; X-CSE-ConnectionGUID: uKsl2jZ6SPWOKQLhkVaSNw== X-CSE-MsgGUID: WMR/Zm4rTWGVY3nAt08cHw== X-IronPort-AV: E=McAfee;i="6800,10657,11718"; a="61179793" X-IronPort-AV: E=Sophos;i="6.21,322,1763452800"; d="scan'208";a="61179793" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2026 09:05:10 -0800 X-CSE-ConnectionGUID: 42vspmOXQ1uSfbHYOqAP4Q== X-CSE-MsgGUID: djzpvM6/TxGaJBkpXBdSrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,322,1763452800"; d="scan'208";a="218031350" Received: from pgcooper-mobl3.ger.corp.intel.com (HELO [10.245.245.25]) ([10.245.245.25]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2026 09:05:08 -0800 Message-ID: <55846862-3482-4b01-bf57-2201ce642aab@linux.intel.com> Date: Tue, 3 Mar 2026 18:05:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/syncobj: Fix handle <-> fd ioctls with dirty stack To: Julian Orth Cc: =?UTF-8?Q?Michel_D=C3=A4nzer?= , =?UTF-8?Q?Christian_K=C3=B6nig?= , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Dmitry Osipenko , Rob Clark , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20260301-point-v1-1-21fc5fd98614@gmail.com> <3c969254-ed38-4b13-84b3-5afa365b04cb@amd.com> <2b75199f-b78a-4915-8e75-5d186f63f7c5@mailbox.org> Content-Language: en-US From: Maarten Lankhorst In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hey, Den 2026-03-03 kl. 17:54, skrev Julian Orth: > On Tue, Mar 3, 2026 at 5:40 PM Maarten Lankhorst > wrote: >> >> There is precedence in the ioctl, the pad member is checked against zero for the same reason. > > I don't believe that this is comparable. Developers of code developed > against an older kernel could look at the kernel and see that the pad > field was checked against zero. They could not see the same for fields > that didn't exist at the time. > >> The check was there because it is invalid to pass when IMPORT/EXPORT_SYNC_FILE was not set. >> >> This is what I would recommend instead: >> >> [...] >> >> + if (!(args->flags & DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_TIMELINE) && >> + !(args->flags & DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE) && >> + args->point) >> + return -EINVAL; > > Should it not be > > + if ((!(args->flags & DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_TIMELINE) || > + !(args->flags & DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE)) && > + args->point) > + return -EINVAL; Yeah copy paste error. :)