Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753016AbbGaQ0M (ORCPT ); Fri, 31 Jul 2015 12:26:12 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:33746 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbbGaQ0L (ORCPT ); Fri, 31 Jul 2015 12:26:11 -0400 MIME-Version: 1.0 In-Reply-To: References: From: cee1 Date: Sat, 1 Aug 2015 00:25:50 +0800 Message-ID: Subject: Re: Revisit AF_BUS: is it a better way to implement KDBUS? To: Andy Lutomirski Cc: LKML , Greg KH , Lennart Poettering , David Herrmann , One Thousand Gnomes Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1090 Lines: 31 2015-07-31 2:12 GMT+08:00 Andy Lutomirski : > > I find myself wondering whether an in-kernel *bus* is a good idea at > all. Creating a bus that unprivileged programs are allowed to > broadcast on (which is kind of the point) opens up big cans of worms. This can be solved in this AF_BUS like this: * Becoming a bus master needs a proper CAP. * Impose a bus endpoint to join multicast address "maddr1" first, if it wants to send to multicast address "maddr2". The bus endpoint sends the request of joining maddr1, and the bus master grants it with replying a cmsg(control message) and setting up a proper eBPF. Next time, the bus endpoint sends to maddr2, the kernel will allow this if: 1) maddr1 & maddr2 == maddr1 And 2) the eBPF allows it. (i.e. the same multicast match logic in this AF_BUS) -- Regards, - cee1 -- 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/