NetBSD Problem Report #61098

From www@netbsd.org  Tue Dec  1 06:45:38 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id ED05D1A923B
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  1 Dec 2026 06:45:37 +0000 (UTC)
Message-Id: <20261201064536.C4CB81A923D@mollari.NetBSD.org>
Date: Tue,  1 Dec 2026 06:45:36 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: drm: missing fd type check in sync_file_get_fence
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         61098
>Category:       kern
>Synopsis:       drm: missing fd type check in sync_file_get_fence
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 01 06:50:00 +0000 2026
>Closed-Date:    
>Last-Modified:  Tue Dec 01 06:55:00 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10
>Organization:
Acme Syncs and Fences, Inc.
>Environment:
>Description:

	Missing fp->f_ops check here -- could be any fd:

    216 	if ((fp = fd_getfile(fd)) == NULL)
    217 		return NULL;
    218 	sf = fp->f_data;
    219 	fence = dma_fence_get(sf->sf_fence);
    220 	fd_putfile(fd);

	https://nxr.netbsd.org/xref/src/sys/external/bsd/drm2/linux/linux_sync_file.c?r=1.3#216

	Reported by D Benali.

>How-To-Repeat:

	code inspection

>Fix:

	check fp->f_ops

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Tue, 01 Dec 2026 06:52:19 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-11 and pullup-10


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/61098 CVS commit: src/sys/external/bsd/drm2/linux
Date: Tue, 1 Dec 2026 06:51:50 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Tue Dec  1 06:51:50 UTC 2026

 Modified Files:
 	src/sys/external/bsd/drm2/linux: linux_sync_file.c

 Log Message:
 drm: Fix missing fd type check.

 PR kern/61098: drm: missing fd type check in sync_file_get_fence


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/linux/linux_sync_file.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.