From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman) Subject: Re: kdbus: add driver skeleton, ioctl entry points and utility functions Date: Wed, 29 Oct 2014 20:50:33 -0700 Message-ID: <87egtqw706.fsf@x220.int.ebiederm.org> References: <1414620056-6675-1-git-send-email-gregkh@linuxfoundation.org> <1414620056-6675-4-git-send-email-gregkh@linuxfoundation.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1414620056-6675-4-git-send-email-gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> (Greg Kroah-Hartman's message of "Wed, 29 Oct 2014 15:00:47 -0700") Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Greg Kroah-Hartman Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org, desrt-0xnayjDhYQY@public.gmane.org, hadess-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org, dh.herrmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, tixxdz-Umm1ozX2/EEdnm+yROfE0A@public.gmane.org, simon.mcvittie-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org, daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org, alban.crequy-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org, javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org, teg-B22kvLQNl6c@public.gmane.org List-Id: linux-api@vger.kernel.org Greg Kroah-Hartman writes: > From: Daniel Mack > > Add the basic driver structure. > > handle.c is the main ioctl command dispatcher that calls into other parts > of the driver. > > main.c contains the code that creates the initial domain at startup, and > util.c has utility functions such as item iterators that are shared with > other files. > > limits.h describes limits on things like maximum data structure sizes, > number of messages per users and suchlike. Some of the numbers currently > picked are rough ideas of what what might be sufficient and are probably > rather conservative. > > Signed-off-by: Daniel Mack > Signed-off-by: Greg Kroah-Hartman > +/* kdbus control device commands */ > +static long kdbus_handle_ioctl_control(struct file *file, unsigned int cmd, > + void __user *buf) > +{ > + case KDBUS_CMD_DOMAIN_MAKE: { > + const char *name; > + > + if (!capable(CAP_IPC_OWNER)) { > + ret = -EPERM; > + break; > + } I don't know if this is exploitable (given that this happens in an ioctl) but capable checks outside of open usually are. Eric