[PATCH] decode mtd/ubi ioctls

Mike Frysinger vapier at gentoo.org
Sat May 4 03:15:52 UTC 2013


On Thursday 02 May 2013 19:03:30 Dmitry V. Levin wrote:
> On Wed, May 01, 2013 at 11:35:30PM -0400, Mike Frysinger wrote:
> > +int ubi_ioctl(struct tcb *tcp, long code, long arg)
> > +{
> > +	struct ubi_mkvol_req mkvol;
> > +	struct ubi_rsvol_req rsvol;
> > +	struct ubi_rnvol_req rnvol;
> > +	struct ubi_attach_req attach;
> > +	struct ubi_map_req map;
> > +	struct ubi_set_vol_prop_req prop;
> > +	/* 4*(n-1) + 3 for quotes and NUL */
> > +	char vol_name[(UBI_MAX_VOLUME_NAME + 1) * 4];
> > +
> > +	if (entering(tcp))
> > +		return 0;
> > +
> > +	switch (code) {
> > +	case UBI_IOCMKVOL:
> > +		if (!verbose(tcp) || umove(tcp, arg, &mkvol) < 0)
> > +			return 0;
> 
> In this and many other similar cases, it looks like failed ioctl syscall
> shouldn't be decoded in detail.  Please have a look whether my guess is
> correct in case of mtd.c; if it is correct, then the code could be changed
> to
> 
> 	if (entering(tcp) || syserror(tcp) || !verbose(tcp))
> 		return 0;

unfortunately, i don't think we want that.  if we get back something like 
EINVAL because the struct was incorrect, there's no way for us to figure things 
out easily.

maybe instead we want to do (syserror(tcp) && abbrev()) ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20130503/669061e4/attachment.bin>


More information about the Strace-devel mailing list