summaryrefslogtreecommitdiffstats
path: root/sys/fs/coda/coda_venus.c
Commit message (Collapse)AuthorAgeFilesLines
* Properly bounds check ioctl/pioctl data arguments for Coda:rwatson2010-08-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | 1. Use unsigned rather than signed lengths 2. Bound messages to/from Venus to VC_MAXMSGSIZE 3. Bound messages to/from general user processes to VC_MAXDATASIZE 4. Update comment regarding data limits for pioctl Without (1) and (3), it may be possible for unprivileged user processes to read sensitive portions of kernel memory. This issue is only present if the Coda kernel module is loaded and venus (the userspace Coda daemon) is running and has /coda mounted. As Coda is considered experimental and production use is warned against in the coda(4) man page, and because Coda must be explicitly configured for a configuration to be vulnerable, we won't be issuing a security advisory. However, if you are using Coda, then you are advised to apply these fixes. Reported by: Dan J. Rosenberg <drosenberg at vsecurity.com> Obtained from: NetBSD (Christos Zoulas) Security: Kernel memory disclosure; no advisory as feature experimental MFC after: 3 days
* Synchronize Coda kernel module definitions in our coda.h to Coda 6'srwatson2010-04-051-28/+32
| | | | | | | | | | | | | | | | | | | coda.h: - CodaFid typdef -> struct CodaFid throughout. - Use unsigned int instead of unsigned long for venus_dirent and other cosmetic fixes. - Introduce cuid_t and cgid_t and use instead of uid_t and gid_t in RPCs. - Synchronize comments and macros. - Use u_int32_t instead of unsigned long for coda_out_hdr. With these changes, a 64-bit Coda kernel module now works with coda6_client, whereas previous userspace and kernel versions of RPCs differed sufficiently to prevent using the file system. This has been verified only with casual testing, but /coda is now usable for at least basic operations on amd64. MFC after: 1 week
* Fix few missed accmode changes in coda.trasz2008-11-031-2/+4
| | | | Approved by: rwatson (mentor)
* Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed threadattilio2008-08-281-4/+6
| | | | | | was always curthread and totally unuseful. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* Since we're now actively maintaining the Coda module in the FreeBSD sourcerwatson2008-02-101-484/+501
| | | | | | | | | | | tree, restyle everything but coda.h (which is more explicitly shared across systems) into a closer approximation to style(9). Remove a few more unused function prototypes. Add or clarify some comments. MFC after: 1 month
* Various further non-functional cleanups to coda:rwatson2008-02-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Rename print_vattr to coda_print_vattr and make static, rename print_cred to coda_print_cred. - Remove unused coda_vop_nop. - Add XXX comment because coda_readdir forwards to the cache vnode's readdir rather than venus_readdir, and annotate venus_readdir as unused. - Rename vc_nb_* to vc_*. - Use d_open_t, d_close_t, d_read_t, d_write_t, d_ioctl_t and d_poll_t for prototyping vc_* as that is the intent, don't use our own definitions. - Rename coda_nb_statfs to coda_statfs, rename NB_SFS_SIZ to CODA_SFS_SIZ. - Replace one more OBE reference to NetBSD with a reference to FreeBSD. - Tidy up a little vertical whitespace here and there. - Annotate coda_nc_zapvnode as unused. - Remove unused vcodattach. - Annotate VM_INTR as unused. - Annotate that coda_fhtovp is unused and doesn't match the FreeBSD prototype, so isn't hooked up to vfs_fhtovp. If we want NFS export of Coda to work someday, this needs to be fixed. - Remove unused getNewVnode. - Remove unused coda_vget, coda_init, coda_quotactl prototypes. MFC after: 1 month
* The Coda module was originally ported to NetBSD from Mach by rvb, andrwatson2008-02-081-1/+1
| | | | | | | | | | then later to FreeBSD. Update various NetBSD-related comments: in some cases delete them because they don't appply, in others update to say FreeBSD as they still apply but in FreeBSD (and might for that matter no longer apply on NetBSD), and flag one case where I'm not sure whether it applies. MFC after: 1 month
* Complete repo-copy and move of Coda from src/sys/coda to src/sys/fs/codarwatson2007-07-121-4/+4
| | | | | | | | | | by removing files from src/sys/coda, and updating include paths in the new location, kernel configuration, and Makefiles. In one case add $FreeBSD$. Discussed with: anderson, Jan Harkes <jaharkes@cs.cmu.edu> Approved by: re (kensmith) Repo-copy madness: simon
* Replace CODA_OPEN with CODA_OPEN_BY_FD: coda_open was disabled becauserwatson2007-07-111-13/+6
| | | | | | | | | | | we can't open container files by device/inode number pair anymore. Replace the CODA_OPEN upcall with CODA_OPEN_BY_FD, where venus returns an open file descriptor for the container file. We can then grab a reference on the vnode coda_psdev.c:vc_nb_write and use this vnode for further accesses to the container file. Submitted by: Jan Harkes <jaharkes@cs.cmu.edu> Approved by: re (kensmith)
* Disable two users of findcdev. They do the wrong thing now and willphk2005-03-151-0/+4
| | | | | need to be fixed. In both cases the API should be reengineered to do something (more) sensible.
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().phk2005-01-111-3/+2
| | | | | | | | | | | | | | | | | | I'm not sure why a credential was added to these in the first place, it is not used anywhere and it doesn't make much sense: The credentials for syncing a file (ability to write to the file) should be checked at the system call level. Credentials for syncing one or more filesystems ("none") should be checked at the system call level as well. If the filesystem implementation needs a particular credential to carry out the syncing it would logically have to the cached mount credential, or a credential cached along with any delayed write data. Discussed with: rwatson
* Start each of the license/copyright comments with /*-imp2005-01-051-1/+1
|
* Second half of the dev_t cleanup.phk2004-06-171-1/+1
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-1/+1
| | | | Bump __FreeBSD_version accordingly.
* Device megapatch 5/6:phk2004-02-211-2/+1
| | | | | | | | | | | | Remove the unused second argument from udev2dev(). Convert all remaining users of makedev() to use udev2dev(). The semantic difference is that udev2dev() will only locate a pre-existing dev_t, it will not line makedev() create a new one. Apart from the tiny well controlled windown in D_PSEUDO drivers, there should no longer be any "anonymous" dev_t's in the system now, only dev_t's created with make_dev() and make_dev_alias()
* Add support for the Coda 6.x venus<->kernel interface. This extendstjr2003-09-071-46/+57
| | | | | | | | | | | | | | FIDs to be 128-bits wide and adds support for realms. Add a new CODA_COMPAT_5 option, which requests support for the old Coda 5.x interface instead of the new one. Create a new coda5.ko module that supports the 5.x interface, and make the existing coda.ko module use the new 6.x interface. These modules cannot both be loaded at the same time. Obtained from: Jan Harkes & the coda-6.0.2 distribution, NetBSD (drochner) (CODA_COMPAT_5 option).
* Use __FBSDID().obrien2003-06-101-3/+3
|
* Fix these warns where sizeof(int) != sizeof(void *)njl2002-09-261-4/+4
| | | | | | | | | | | | | | | | /h/des/src/sys/coda/coda_venus.c: In function `venus_ioctl': /h/des/src/sys/coda/coda_venus.c:277: warning: cast from pointer to integer of different size /h/des/src/sys/coda/coda_venus.c:292: warning: cast from pointer to integer of different size /h/des/src/sys/coda/coda_venus.c: In function `venus_readlink': /h/des/src/sys/coda/coda_venus.c:380: warning: cast from pointer to integer of different size /h/des/src/sys/coda/coda_venus.c: In function `venus_readdir': /h/des/src/sys/coda/coda_venus.c:637: warning: cast from pointer to integer of different size Submitted by: des-alpha-tinderbox
* Lock proctree_lock instead of pgrpsess_lock.jhb2002-04-161-2/+2
|
* Fix LINT breakage by adding a missing include.tmm2002-02-231-0/+1
|
* Lock struct pgrp, session and sigio.tanimura2002-02-231-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-2/+4
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Delete unused #include <sys/select.h>.wollman2001-01-091-1/+0
|
* Protect accesses to member of struct proc with the proc lock.jhb2000-12-061-0/+4
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* The dev returned here is what is found in the st_dev field.rvb1999-08-021-2/+3
| | | | This should not be further translated ... hence the 0.
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* coda_lookup now passes up an extra flag. But old veni willrvb1998-11-111-1/+13
| | | | | | | be ok; new veni will check /dev/cfs0 to make sure that a new kernel is running. Also, a bug in vc_nb_close iff CODA_SIGNAL's were seen has been fixed.
* Venus must be passed O_CREAT flag on VOP_OPEN iff this isrvb1998-10-281-1/+2
| | | | | | a creat so that we can will allow a mode 444 file to be written into. Sync with the latest coda.h and deal with collateral damage.
* Finish conversion of cfs -> codarvb1998-09-131-5/+5
|
* All the references to cfs, in symbols, structs, and stringsrvb1998-09-111-121/+121
| | | | have been changed to coda. (Same for CFS.)
* Pass2 completervb1998-09-021-42/+35
|
* Very Preliminary Codarvb1998-08-291-0/+654
OpenPOWER on IntegriCloud