Module Name: src Committed By: mrg Date: Thu Jul 4 05:59:05 UTC 2024
Modified Files: src/sys/kern: vfs_syscalls.c Log Message: don't fd_putfile() if you haven't grabbed a ref already. the condition to call fd_getvnode() was changed, but the condition to call fd_putfile() afterwards was not changed, leading to a panic seen by Chavdar on current-users, probably. builds, runs, seems obvious. To generate a diff of this commit: cvs rdiff -u -r1.564 -r1.565 src/sys/kern/vfs_syscalls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/vfs_syscalls.c diff -u src/sys/kern/vfs_syscalls.c:1.564 src/sys/kern/vfs_syscalls.c:1.565 --- src/sys/kern/vfs_syscalls.c:1.564 Mon Jul 1 00:58:04 2024 +++ src/sys/kern/vfs_syscalls.c Thu Jul 4 05:59:05 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.c,v 1.564 2024/07/01 00:58:04 christos Exp $ */ +/* $NetBSD: vfs_syscalls.c,v 1.565 2024/07/04 05:59:05 mrg Exp $ */ /*- * Copyright (c) 2008, 2009, 2019, 2020, 2023 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.564 2024/07/01 00:58:04 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.565 2024/07/04 05:59:05 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_fileassoc.h" @@ -245,7 +245,7 @@ fd_nameiat(struct lwp *l, int fdat, stru error = namei(ndp); - if (fdat != AT_FDCWD) + if (fdat != AT_FDCWD && path[0] != '/') fd_putfile(fdat); out: pathbuf_stringcopy_put(ndp->ni_pathbuf, path); @@ -279,7 +279,7 @@ fd_nameiat_simple_user(struct lwp *l, in error = nameiat_simple(dvp, pb, sflags, vp_ret); - if (fdat != AT_FDCWD) + if (fdat != AT_FDCWD && path[0] != '/') fd_putfile(fdat); out: