From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dmitry V. Levin" Subject: Re: [PATCH v3 4/5] drm: Add decoding of i915 ioctls Date: Fri, 3 Jul 2015 03:36:09 +0300 Message-ID: <20150703003609.GB29080@altlinux.org> References: <1435755168-16207-1-git-send-email-patrik.jakobsson@linux.intel.com> <1435755168-16207-5-git-send-email-patrik.jakobsson@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0134766515==" Return-path: Received: from pegasus3.altlinux.org (pegasus3.altlinux.org [194.107.17.103]) by gabe.freedesktop.org (Postfix) with ESMTP id CF9356E209 for ; Thu, 2 Jul 2015 17:36:10 -0700 (PDT) In-Reply-To: <1435755168-16207-5-git-send-email-patrik.jakobsson@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Patrik Jakobsson Cc: intel-gfx@lists.freedesktop.org, strace-devel@lists.sourceforge.net List-Id: intel-gfx@lists.freedesktop.org --===============0134766515== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9zSXsLTf0vkW971A" Content-Disposition: inline --9zSXsLTf0vkW971A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 01, 2015 at 02:52:47PM +0200, Patrik Jakobsson wrote: [...] > --- a/drm.c > +++ b/drm.c > @@ -35,6 +35,9 @@ > =20 > #define DRM_MAX_NAME_LEN 128 > =20 > +extern int drm_i915_decode_number(struct tcb *tcp, unsigned int arg); Please rename "arg" to "code", and ... > +extern int drm_i915_ioctl(struct tcb *tcp, const unsigned int code, long= arg); =2E.. move both declarations to defs.h to make them visible also in the file where these functions are defined. [...] > +static int i915_setparam(struct tcb *tcp, const unsigned int code, long = arg) > +{ > + struct drm_i915_setparam param; > + > + if (entering(tcp)) { > + if (umove(tcp, arg, ¶m)) > + return 0; > + > + tprints(", {param=3D"); > + printxval(drm_i915_setparams, param.param, "I915_PARAM_???"); > + tprintf(", value=3D%d}", param.value); > + } > + > + return 1; > +} In this and most of other parsers of _IOC_WRITE ioctls added by this and the next patches, any error in parser that leads to "return 0" will result to disabled "arg" decoding, including the fallback decoding performed by sys_ioctl. Maybe it's time to deal with this issue in a more generic way. --=20 ldv --9zSXsLTf0vkW971A Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWV2PkACgkQfKvmrJ41Nh4MOwCggGfPBHLA8oy9S0Jgg4t2+v+i lvYAnRVT7kVvq1kb1FRyWetzGa20hCve =WDDo -----END PGP SIGNATURE----- --9zSXsLTf0vkW971A-- --===============0134766515== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============0134766515==--