From: Rob Browning <rlb@defaultvalue.org>
To: Christoph Hellwig <hch@infradead.org>,
Aurelien Jarno <aurelien@aurel32.net>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org,
Robert Edmonds <edmonds@debian.org>,
daryl5@arcor.de
Subject: Re: Argument type for FS_IOC_GETFLAGS/FS_IOC_SETFLAGS ioctls
Date: Mon, 30 Jun 2014 17:51:08 -0500 [thread overview]
Message-ID: <87simm2eqr.fsf@trouble.defaultvalue.org> (raw)
In-Reply-To: <20131127101536.GA24697@infradead.org>
Christoph Hellwig <hch@infradead.org> writes:
> The problem is that as you indeed pointed out the ABI is that an int
> needs to be passed. The _IOR/_IOW generate a ioctl number based on
> a few inputs including the type of the argument, which is just
> passed to sizeof. So the supposedly self-documenting ioctl defintions
> disagree with the actual ABI.
>
> There's nothing that can be fixed in the kernel except for better
> documenting the actual ABI, and why the ioctl defintion is very misleading
> in this case.
>
> The userspace programs that were mislead by this will need to fixed.
So we haven't delved deeply yet, but here's a presumably little-endian,
64-bit system where using an int with FS_IOC_GETFLAGS appears to corrupt
the stack:
https://groups.google.com/d/msg/bup-list/y4CW6Ib7XUk/sCy7AUHhiKYJ
and here's the relevant call:
https://github.com/bup/bup/blob/0e0b5324699342601ce1b9a97c0a2e1faf6fe7ff/lib/bup/_helpers.c#L830
--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
prev parent reply other threads:[~2014-06-30 22:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 20:05 Argument type for FS_IOC_GETFLAGS/FS_IOC_SETFLAGS ioctls Aurelien Jarno
2013-11-27 1:01 ` Darrick J. Wong
2013-11-27 4:00 ` Theodore Ts'o
2013-11-27 10:03 ` Aurelien Jarno
2013-11-27 13:34 ` Theodore Ts'o
2013-11-27 18:14 ` Robert Edmonds
2013-11-27 23:14 ` Aurelien Jarno
2013-11-29 0:53 ` Andreas Dilger
2013-11-29 4:54 ` Theodore Ts'o
2013-11-29 5:27 ` Dave Chinner
2013-11-29 14:22 ` Theodore Ts'o
2013-11-29 16:32 ` Rob Browning
2013-12-01 22:20 ` Dave Chinner
2013-12-02 4:52 ` Theodore Ts'o
2013-12-02 22:30 ` Dave Chinner
2013-11-29 21:55 ` Andreas Dilger
2013-12-19 18:20 ` Rob Browning
2013-12-19 23:30 ` Darrick J. Wong
2013-11-27 10:15 ` Christoph Hellwig
2014-06-30 22:51 ` Rob Browning [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87simm2eqr.fsf@trouble.defaultvalue.org \
--to=rlb@defaultvalue.org \
--cc=aurelien@aurel32.net \
--cc=daryl5@arcor.de \
--cc=edmonds@debian.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.