NetBSD Problem Report #39124

From reinoud@13thmonkey.org  Thu Jul 10 16:24:33 2008
Return-Path: <reinoud@13thmonkey.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id B172863B9AA
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 10 Jul 2008 16:24:33 +0000 (UTC)
Message-Id: <20080710162436.4664F5C2C@aardappel.13thmonkey.org>
Date: Thu, 10 Jul 2008 18:24:36 +0200 (CEST)
From: reinoud@NetBSD.org
Reply-To: reinoud@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: VOP_CREATE() gets no uid/gid in vattr
X-Send-Pr-Version: 3.95

>Number:         39124
>Category:       kern
>Synopsis:       VOP_CREATE() gets no uid/gid in vattr
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 10 16:25:00 +0000 2008
>Last-Modified:  Thu Jul 10 16:45:01 +0000 2008
>Originator:     Reinoud Zandijk
>Release:        NetBSD 4.99.55
>Organization:
NetBSD

>Environment:


System: NetBSD aardappel.13thmonkey.org 4.99.55 NetBSD 4.99.55 (GENERIC) #0: Sun Mar 2 21:22:35 CET 2008 reinoud@heethoofdje.13thmonkey.org:/usr/sources/cvs.netbsd.org/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
When implementing UDF i found that the vattr argument passed on every
VOP_CREATE() always specified (uid=-1, gid=-1). I assumed these were the
defaults and that the kernel would issue a VOP_SETATTR() with the correct
uid/gid later.

When confronted with wierd uid/gid access results, i dug into tmpfs and UFS
and noticed that they didn't even pass the vattr down but both use
	uid = kauth_cred_geteuid(cnp->cn_cred);
	gid = parent_dir->gid;

Shouldn't these uid/gid's be passed in the VOP_CREATE()'s vattr?


>How-To-Repeat:
Check the passed uid/gid on VOP_CREATE() to any FS.

>Fix:
Take up this code in the VOP_CREATE() calling code or in the veneers?



>Audit-Trail:
From: Reinoud Zandijk <reinoud@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39124 CVS commit: src/sys/fs/udf
Date: Thu, 10 Jul 2008 16:41:00 +0000 (UTC)

 Module Name:	src
 Committed By:	reinoud
 Date:		Thu Jul 10 16:41:00 UTC 2008

 Modified Files:
 	src/sys/fs/udf: udf_subr.c

 Log Message:
 On node creation, follow tmpfs and UFS by generating the uid/gid pair. This
 fixes the lack of file ownership preservation on file/directory creation.

 See PR kern/39124


 To generate a diff of this commit:
 cvs rdiff -r1.55 -r1.56 src/sys/fs/udf/udf_subr.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.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.