On Sun, Oct 30, 2016 at 10:48:39AM +0200, Matan Barak wrote: > On Fri, Oct 28, 2016 at 5:46 PM, Leon Romanovsky <leonro@xxxxxxxxxxxx> wrote: > > On Fri, Oct 28, 2016 at 08:37:25AM -0700, Christoph Hellwig wrote: > >> On Fri, Oct 28, 2016 at 06:33:06PM +0300, Leon Romanovsky wrote: > >> > Just to summarize, to be sure that I understood you correctly. > >> > > >> > | write | -> | conversion logic | --- > >> > | ioctl | --------------------------- > >> > > >> > Am I right? > >> > >> Yes, as long as the write and ioctl boxes do the copy_{from,to}_user. > If we accept the limitations here (i.e - all commands attributes > come either from kernel or from user, but you can't mix them - > that's mean the write comparability layer either needs to copy all > attributes or use a direct mapping for all of them), I could just > either break ib_uverbs_cmd_verbs to a a few functions or just pass a > callback of boxing the descriptors copy. >From what I saw in the series, this looks easy enough to fix.. Just lightly refactor things so that the write() compat layer can call into the ioctl processor with an already prepared tlv list in kernel memory and form such a list on the stack when doing the compat stuff. The bigger problem is the tlv list pointers themselves, they have to point to user memory so the compat layer can only do so much of a transformation. I guess another flag in the copy_from_user wrapper would do the trick if we need it. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html