Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1235529 > unrolled thread

Re: [PATCH] mtd: provide proper 32/64-bit compat_ioctl() support for BLKPG

Started byBrian Norris <computersforpeace@gmail.com>
First post2015-09-29 22:40 +0200
Last post2015-09-29 22:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] mtd: provide proper 32/64-bit compat_ioctl() support for  BLKPG Brian Norris <computersforpeace@gmail.com> - 2015-09-29 22:40 +0200

#1235529 — Re: [PATCH] mtd: provide proper 32/64-bit compat_ioctl() support for BLKPG

FromBrian Norris <computersforpeace@gmail.com>
Date2015-09-29 22:40 +0200
SubjectRe: [PATCH] mtd: provide proper 32/64-bit compat_ioctl() support for BLKPG
Message-ID<qe9QR-oL-1@gated-at.bofh.it>
On Mon, Sep 21, 2015 at 01:26:59PM -0700, Brian Norris wrote:
> After a bit of poking around wondering why my 32-bit user-space can't
> seem to send a proper ioctl(BLKPG) to an MTD on my 64-bit kernel
> (ARM64), I noticed that struct blkpg_ioctl_arg is actually pretty
> unsuitable for use in the ioctl() ABI, due to its use of raw pointers,
> and its lack of alignment/packing restrictions (32-bit arch'es tend to
> pack the 4 fields into 4 32-bit words, whereas 64-bit arch'es would add
> padding after the third int, and make this 6 32-bit words).
> 
> Anyway, this means BLKPG deserves some special compat_ioctl handling. Do
> the conversion in a small shim for MTD.
> 
> block/compat_ioctl.c already has compat support for the block subsystem,
> but it does so by a re-marshalling data to/from user-space (see
> compat_blkpg_ioctl()). Personally, I think this approach is cleaner.
> 
> Tested only on MTD, with an ARM32 user space on an ARM64 kernel.
> 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> ---
> You can find the initial bug report / patch here:
> 
>   http://article.gmane.org/gmane.linux.kernel/2028927
>   https://lkml.org/lkml/2015/8/28/594
> 
> Changes since RFC:
>  * create new non-UAPI header, instead of cluttering the UAPI header with
>    compat stuff
>  * remove mention of "same bug in block/", since block/ solves this problem
>    already, just in a slightly different way

Pushed to l2-mtd.git
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web