From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) (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 85629439011 for ; Tue, 3 Mar 2026 17:18:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772558333; cv=none; b=NjtG3dXswjS5n8Q5moZe2HBvvHO6SAaijPlLQdRVdW0aM0cNeodZxduOPHJGj4sQH1JMiGEyna4OTH1h9LzV0IC1LzP1Wxex266PxWR6msXjY7e2reQxqUlVBqu5udzF4AbRp9ZwwsSbyCQYwSbuCQstHlYgablCv1vGODBW3Mw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772558333; c=relaxed/simple; bh=+djVDTbHNKTr1nnIxa6QLBzEf2CvFAYWDrsUdmZ3uzY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oLoawpgAEtE92Afxrbc/lQUaRqpzpFrNSz3cmQURDNX+pYN2D9rwwPIyqLsQLnqjQCTLOfQ2cqXJxGMXt63jSISw6UJut80TkGQzIVlcUQSngCe1lSQbGvD+1UsJo6J6tyMXto/f3idmadNiiYWz503tnQzZhqGYp+SpdpbaeyE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=s0yL75+u; arc=none smtp.client-ip=80.241.56.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="s0yL75+u" Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (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) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4fQMw75L1Dz9ttn; Tue, 3 Mar 2026 18:18:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1772558327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=57pV7c+FJuc1HvaILSoKBLthsTCcmh01hC80CxELoYI=; b=s0yL75+uytdHIYSxa5o9H0f7ImsIcC2IUyXahKlRavZW9J+zOrhmxasg028qeRTyTxwadq T9Qi+sIu4DQ4pl7uOld3+I4fFg8pPjE9SqYxruvGADGEkNrNYYOHhI9G1jdl6Xof/6gF9a uBxdRsZumQajR+c4yxlZyNLIfBT/qF6ftk177fEW3K/wlMXKHiqPWM3NgfLFJVvMgVOhg0 HNbH6/Mm6bM9Npi0nC55kO6Y45Me5HxA+llULBMRNNwl9IOQ6d7v9PFdAO0fwpiS3jclMs qBQLVKJAbSgBUzxSa+QukvNd3V8Cx7EaQ4adyZBIoG0ahfnQUSatqfYkKIwJtQ== Message-ID: Date: Tue, 3 Mar 2026 18:18:44 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] drm/syncobj: Fix handle <-> fd ioctls with dirty stack To: Julian Orth Cc: Maarten Lankhorst , =?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> From: =?UTF-8?Q?Michel_D=C3=A4nzer?= Content-Language: en-CA In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MBO-RS-META: w4tqwcwhghi15c49xpsnuo3zwix4st8d X-MBO-RS-ID: 48072cc78177f5b7214 On 3/3/26 18:11, Julian Orth wrote: > On Tue, Mar 3, 2026 at 6:04 PM Michel Dänzer wrote: >> On 3/3/26 17:54, Julian Orth wrote: >>> 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. >> >> "Initialize only known fields" isn't a valid approach here. The full struct must be initialized to 0, including any fields added in the future. > > It worked from the introduction of the ioctl until the new field was > added. How could anyone know about this requirement if it is not > documented? Some people might not even know that ioctl numbers encode > the size of the argument and therefore assume that the argument > structure is fixed. I think this is quite different from syscalls such > as clone3 which make the size argument explicit and where it can be > expected that the developer knows that the struct might grow when the > application is recompiled. > > The new flag was added so that userspace can detect older kernels that > don't support the point field, such kernels return EINVAL when they > see the new flag. > Then why should the kernel not also use the absence of the flag to > detect older userspace that might be unaware of the point field? I wrote in my first post in this thread that I don't object to your patch, so you can relax and stop trying to convince me not to object to it. :) I'm just pointing out that this is working around broken user-space code, and that there are other similar cases where that kind of broken users-space code couldn't be worked around in the kernel, so it's better to also fix the user-space code anyway. -- Earthling Michel Dänzer \ GNOME / Xwayland / Mesa developer https://redhat.com \ Libre software enthusiast