From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932990AbcK1NmS (ORCPT ); Mon, 28 Nov 2016 08:42:18 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:63077 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932942AbcK1NmE (ORCPT ); Mon, 28 Nov 2016 08:42:04 -0500 To: jobol@nonadev.net Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC 1/1] LSM ptags: Add tagging of processes From: Tetsuo Handa References: <1479893597-5022-1-git-send-email-jobol@nonadev.net> <1479893597-5022-2-git-send-email-jobol@nonadev.net> <201611261325.FGC60477.HJtOOSQFOFFMVL@I-love.SAKURA.ne.jp> <1480324296.2089.1.camel@nonadev.net> In-Reply-To: <1480324296.2089.1.camel@nonadev.net> Message-Id: <201611282241.FCF69778.FFMOFQLJtSVOOH@I-love.SAKURA.ne.jp> X-Mailer: Winbiff [Version 2.51 PL2] X-Accept-Language: ja,en,zh Date: Mon, 28 Nov 2016 22:41:53 +0900 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jose Bollo wrote: > The fact is that ptags is seat behind the implementation of the special > files in /proc/PID/attr/.. Thus, it has to return an allocated buffer. > I'm not aware of what kind of allocation is possible to use for this > subsystem. Is it possible to use vmalloc? I dont know. If you replace kfree() with kvfree() in proc_pid_attr_read() in fs/proc/base.c , you will be able to use vmalloc(). However, proc_pid_attr_write() accepts only PAGE_SIZE bytes from the beginning. If you want to use attributes longer than PAGE_SIZE bytes, I think that you will need to use a different interface because implementing I/O protocol for ptags which reads/writes PAGE_SIZE bytes chunk at a time using /proc/PID/attr/ interface is not userspace friendly.