diff options
author | rwatson <rwatson@FreeBSD.org> | 2010-08-07 08:08:14 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2010-08-07 08:08:14 +0000 |
commit | 0c4bafa8fe11ec3f93dda2e33a7c6cd47e61bf8c (patch) | |
tree | d731ba00620d0e136e1bd412a653a4b1a1930b56 /sys/fs/coda/coda.h | |
parent | c750c1a10865a5a1aec7065dc67a2c499792c614 (diff) | |
download | FreeBSD-src-0c4bafa8fe11ec3f93dda2e33a7c6cd47e61bf8c.zip FreeBSD-src-0c4bafa8fe11ec3f93dda2e33a7c6cd47e61bf8c.tar.gz |
Properly bounds check ioctl/pioctl data arguments for Coda:
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
Diffstat (limited to 'sys/fs/coda/coda.h')
-rw-r--r-- | sys/fs/coda/coda.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/fs/coda/coda.h b/sys/fs/coda/coda.h index ee1e760..2cfb712 100644 --- a/sys/fs/coda/coda.h +++ b/sys/fs/coda/coda.h @@ -41,7 +41,9 @@ #ifndef _CODA_HEADER_ #define _CODA_HEADER_ +#ifdef _KERNEL #include "opt_coda.h" /* for CODA_COMPAT_5 option */ +#endif /* Avoid CODA_COMPAT_5 redefinition in coda5 module */ #if defined (CODA5_MODULE) && !defined(CODA_COMPAT_5) @@ -782,8 +784,8 @@ union coda_downcalls { #define PIOCPARM_MASK 0x0000ffff struct ViceIoctl { caddr_t in, out; /* Data to be transferred in, or out */ - short in_size; /* Size of input buffer <= 2K */ - short out_size; /* Maximum size of output buffer, <= 2K */ + unsigned short in_size; /* Size of input buffer <= 8K */ + unsigned short out_size; /* Maximum size of output buffer, <= 8K */ }; #if defined(__CYGWIN32__) || defined(DJGPP) |