Re: [RFC, PATCH] Extensible AIO interface

From: Zach Brown
Date: Tue Oct 02 2012 - 13:43:39 EST


> The generic code wouldn't know about any user pointers inside
> attributes, so it'd have to be downstream consumers. Hopefully there
> won't be many attributes with user pointers in them (I don't expect
> there to be), so we won't have too much of this messyness.

I really don't like this. We should have learned this lesson with ioctl
structs that are nested pointers.

What about security bits that are trying to determine if attributes are
OK?

What about contexts that can't easily deal with userspace pointers? We
tend to copy into relatively more accessible kernel memory as early as
possible.

What about fuse trying to extend this interface out to their fs clients?
Look at the horrible mess it implements to bounce nested ioctl data
parsing between the kernel's user pointer copying and the fuse client's
parsing of that copied data.

Let's not do this again, please. I think it's a fallacy to claim that
the interface can be opaque to high levels and only parsed by lower
levels. The interface should be explicit and fully specified on entry
so that all levels have trivial access to it.

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