Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756644Ab2HNQdu (ORCPT ); Tue, 14 Aug 2012 12:33:50 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:49759 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753100Ab2HNQdr (ORCPT ); Tue, 14 Aug 2012 12:33:47 -0400 MIME-Version: 1.0 In-Reply-To: References: <20120814134020.367361b5@pyramind.ukuu.org.uk> Date: Tue, 14 Aug 2012 18:33:46 +0200 Message-ID: Subject: Re: How to hack syscall-table, in kernel 2.6+ ? From: richard -rw- weinberger To: Ajay Garg Cc: balbi@ti.com, Alan Cox , linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1132 Lines: 27 On Tue, Aug 14, 2012 at 6:13 PM, Ajay Garg wrote: > So, the use-case I am trying to solve, is that only a particular > process should be able to read a group of files, and no one else (i.e. > no-other-user/ no-other-process/no-other-anything). The only exception > is the "root" user, and any user holding "sudo" previleges. > > So, only a particular process (with a specified PID), the superuser, > and any user-carrying-sudo previleges, should be able to read a group > of files. Sounds like a use case for a LSM (like SELinux). Let's suppose you hook open(). Your code will notice open("/bin/foo/", ...) But you cannot just filter for /bin/foo, you have to know much more context. What's the current tasks root directory? Which namespace, etc. Of course you can gather all this information but it will make your code large and buggy. -- Thanks, //richard -- 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/