Thanks!

On Thu, Aug 24, 2006 at 06:52:28PM +0000, Marius Strobl wrote:
> marius      2006-08-24 18:52:28 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/kern             vfs_mount.c 
>   Log:
>   Fix a bug introduced with rev. 1.204; in vfs_donmount() use
>   copyout(9) instead of copystr(9) for copying the errmsg from
>   kernel- to user-space. This fixes a panic on sparc64 when
>   using the nmount(2)-converted mountd(8).
>   While at it, use bcopy(3) instead of strncpy(3) in the kernel-
>   to kernel-space case for consistency with vfs_buildopts() and
>   between kernel- to user-space and kernel- to kernel-space case.
>   
>   Revision  Changes    Path
>   1.229     +4 -5      src/sys/kern/vfs_mount.c
> http://cvsweb.FreeBSD.org/src/sys/kern/vfs_mount.c.diff?r1=1.228&r2=1.229
> | ===================================================================
> | RCS file: /usr/local/www/cvsroot/FreeBSD/src/sys/kern/vfs_mount.c,v
> | retrieving revision 1.228
> | retrieving revision 1.229
> | diff -u -p -r1.228 -r1.229
> | --- src/sys/kern/vfs_mount.c        2006/06/27 14:46:31     1.228
> | +++ src/sys/kern/vfs_mount.c        2006/08/24 18:52:28     1.229
> | @@ -35,7 +35,7 @@
> |   */
> |  
> |  #include <sys/cdefs.h>
> | -__FBSDID("$FreeBSD: 
> /usr/local/www/cvsroot/FreeBSD/src/sys/kern/vfs_mount.c,v 1.228 2006/06/27 
> 14:46:31 jhb Exp $");
> | +__FBSDID("$FreeBSD: 
> /usr/local/www/cvsroot/FreeBSD/src/sys/kern/vfs_mount.c,v 1.229 2006/08/24 
> 18:52:28 marius Exp $");
> |  
> |  #include <sys/param.h>
> |  #include <sys/conf.h>
> | @@ -693,14 +693,13 @@ bail:
> |     if (errmsg_pos != -1 && ((2 * errmsg_pos + 1) < fsoptions->uio_iovcnt)
> |         && errmsg_len > 0 && errmsg != NULL) {
> |             if (fsoptions->uio_segflg == UIO_SYSSPACE) {
> | -                   strncpy(fsoptions->uio_iov[2 * errmsg_pos + 1].iov_base,
> | -                       errmsg, 
> | +                   bcopy(errmsg,
> | +                       fsoptions->uio_iov[2 * errmsg_pos + 1].iov_base,
> |                         fsoptions->uio_iov[2 * errmsg_pos + 1].iov_len);
> |             } else {
> | -                   copystr(errmsg,
> | +                   copyout(errmsg,
> |                         fsoptions->uio_iov[2 * errmsg_pos + 1].iov_base,
> | -                       fsoptions->uio_iov[2 * errmsg_pos + 1].iov_len,
> | -                       NULL);
> | +                       fsoptions->uio_iov[2 * errmsg_pos + 1].iov_len);
> |             } 
> |     }
> |  
> 

Attachment: pgpJgbRULA5nw.pgp
Description: PGP signature



Reply via email to