Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Jun 2009 16:53:25 +0900 (JST)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        rea-fbsd@codelabs.ru
Cc:        amd64@FreeBSD.org, current@FreeBSD.org
Subject:   Re: [head tinderbox] failure on amd64/amd64
Message-ID:  <20090608.165325.225640915.hrs@allbsd.org>
In-Reply-To: <sqWp8ZLqcJhvIOZAWr3MfqIXJ9k@XX1fo6zQUfC4h0jjRC6IBz3oNH4>
References:  <20090608025715.499087302F@freebsd-current.sentex.ca> <8LPG99US2/4EsGlonyfMSkDb40o@XX1fo6zQUfC4h0jjRC6IBz3oNH4> <sqWp8ZLqcJhvIOZAWr3MfqIXJ9k@XX1fo6zQUfC4h0jjRC6IBz3oNH4>

next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart0(Mon_Jun__8_16_53_25_2009_309)--
Content-Type: Multipart/Mixed;
	boundary="--Next_Part(Mon_Jun__8_16_53_25_2009_586)--"
Content-Transfer-Encoding: 7bit

----Next_Part(Mon_Jun__8_16_53_25_2009_586)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Eygene Ryabinkin <rea-fbsd@codelabs.ru> wrote
  in <sqWp8ZLqcJhvIOZAWr3MfqIXJ9k@XX1fo6zQUfC4h0jjRC6IBz3oNH4>:

re> Mon, Jun 08, 2009 at 11:00:56AM +0400, Eygene Ryabinkin wrote:
re> > Looks like that
re> > -----
re> > 		ifr->ifr_data = (caddr_t)(size_t)options;
re> > -----
re> > will be more correct and will disable this warning -- it will convert
re> > u_int to the proper type that will be able to carry addresses for the
re> > given platform.
re>
re> Hmm, looking a bit into the code of gif_ioctl, I am under impression
re> that 'options' will not be initialized at the GIFSOPTS processing.
re> And the statement
re> -----
re>                 if ((error = copyin(&options, &sc->gif_options,
re>                                 sizeof(sc->gif_options)))) {
re> -----
re> looks strange -- (&options) is in the kernel space (stack space),
re> so why one is passing it as the userland address?  Judging by the
re> contents of newly added setgifopts() inside ifgif.c, I would assume
re> that one wants 'ifr->ifr_data' instead of '&options'.
re>
re> Am I missing something?

 Gr, certainly this looks strange.  I meant the attached patch.
 Thanks for pointing out it.

 I will fix the build error as soon as I return home.

-- Hiroki

----Next_Part(Mon_Jun__8_16_53_25_2009_586)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="if_gif.c.diff"

Index: if_gif.c
===================================================================
--- if_gif.c	(revision 193673)
+++ if_gif.c	(working copy)
@@ -914,10 +914,10 @@
 	case GIFSOPTS:
 		if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0)
 			break;
-		if ((error = copyin(&options, &sc->gif_options,
-				sizeof(sc->gif_options)))) {
+		if ((error = copyin(ifr->ifr_data, &options,
+				sizeof(options)))) {
 			if ((options | GIF_FULLOPTS) == GIF_FULLOPTS)
-				ifr->ifr_data = (caddr_t)options;
+				sc->gif_options = options;
 			else
 				error = EINVAL;
 		}

----Next_Part(Mon_Jun__8_16_53_25_2009_586)----

----Security_Multipart0(Mon_Jun__8_16_53_25_2009_309)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEABECAAYFAkosw3UACgkQTyzT2CeTzy3swgCgv3g8llQDGWKj1ZBU88LGwcPa
nxMAn31mmln/T7dDnuwBQcQecQz55hr0
=iFvg
-----END PGP SIGNATURE-----

----Security_Multipart0(Mon_Jun__8_16_53_25_2009_309)----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090608.165325.225640915.hrs>