Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932171AbaAWTbr (ORCPT ); Thu, 23 Jan 2014 14:31:47 -0500 Received: from mail-qc0-f171.google.com ([209.85.216.171]:36870 "EHLO mail-qc0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631AbaAWTbo convert rfc822-to-8bit (ORCPT ); Thu, 23 Jan 2014 14:31:44 -0500 MIME-Version: 1.0 In-Reply-To: <52D7A68F.5030700@redhat.com> References: <1377614400-27122-1-git-send-email-jkaluza@redhat.com> <1389600109-30739-1-git-send-email-jkaluza@redhat.com> <20140115.121730.1984913330507219167.davem@davemloft.net> <1389828103.681.34.camel@flatline.rdu.redhat.com> <20140115232345.GA22237@mtj.dyndns.org> <52D7A68F.5030700@redhat.com> From: Kay Sievers Date: Thu, 23 Jan 2014 20:31:24 +0100 Message-ID: Subject: Re: [PATCH v4 0/3] Send audit/procinfo/cgroup data in socket-level control message To: =?UTF-8?Q?Jan_Kalu=C5=BEa?= Cc: Tejun Heo , Eric Paris , David Miller , LKML , netdev@vger.kernel.org, rgb@redhat.com, lizefan@huawei.com, containers@lists.linux-foundation.org, cgroups@vger.kernel.org, viro@zeniv.linux.org.uk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2014 at 10:29 AM, Jan Kaluža wrote: > On 01/16/2014 12:23 AM, Tejun Heo wrote: >> On Wed, Jan 15, 2014 at 06:21:43PM -0500, Eric Paris wrote: >>> >>> Reliably being able to audit what process requested an action is >>> extremely useful. And I like the audit patch, as it is a couple of ints >>> we are storing. >>> >>> procinfo and cgroup can both be up to 4k of data. >>> >>> Is there an alternative he should consider? Some way to grab a >>> reference on task_struct and just attach that to the message? >> >> Or maybe it can be made separately optional instead of tagging along >> on an existing option so that it doesn't tax use cases which don't >> care about the new stuff? > > Right, I could add new option next to SOCK_PASSCRED which could be used to > send newly added stuff. Would this be acceptable? > > I would still vote for SCM_AUDIT to be part of SOCK_PASSCRED and move > SCM_CGROUP and SCM_PROCINFO into new option. Maybe we could just add a new SOCK_PASS_TASKINFO bit to set in socket->flags. Set that bit with a new SO_PASS_TASKINFO sockoption. The SOCK_PASS_TASKINFO can carry all sorts of "struct task" related stuff, also include the audit data. It is all fully conditional, so users which do not explicitly subscribe to TASKINFO will never see the data or needlessly pay for the overhead. A TASKINFO sounds generic enough to be possibly extended with new data in the future, without wasting extra bits in the socket flags. Users which subscribe with SO_PASS_TASKINFO expect some overhead anyway. In the end it's still a lot cheaper than parsing /proc for the data; which is also racy and does therefore not work for any short-living program. Thanks, Kay -- 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/