Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427AbdCMV7h (ORCPT ); Mon, 13 Mar 2017 17:59:37 -0400 Received: from mail-qt0-f175.google.com ([209.85.216.175]:32841 "EHLO mail-qt0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752758AbdCMV73 (ORCPT ); Mon, 13 Mar 2017 17:59:29 -0400 Subject: Re: [RFC PATCH 00/12] Ion cleanup in preparation for moving out of staging To: Rob Clark References: <1488491084-17252-1-git-send-email-labbott@redhat.com> <20170303132949.GC31582@dhcp22.suse.cz> <20170306074258.GA27953@dhcp22.suse.cz> <20170306104041.zghsicrnadoap7lp@phenom.ffwll.local> <20170306105805.jsq44kfxhsvazkm6@sirena.org.uk> <20170306160437.sf7bksorlnw7u372@phenom.ffwll.local> <26bc57ae-d88f-4ea0-d666-2c1a02bf866f@redhat.com> <6d3d52ba-29a9-701f-2948-00ce28282975@redhat.com> Cc: Daniel Vetter , Benjamin Gaignard , devel@driverdev.osuosl.org, Rom Lemarchand , Linux Kernel Mailing List , Riley Andrews , "dri-devel@lists.freedesktop.org" , Michal Hocko , "linaro-mm-sig@lists.linaro.org" , Linux MM , =?UTF-8?Q?Arve_Hj=c3=b8nnev=c3=a5g?= , Mark Brown , Greg Kroah-Hartman , Daniel Vetter , "linux-arm-kernel@lists.infradead.org" , "linux-media@vger.kernel.org" From: Laura Abbott Message-ID: Date: Mon, 13 Mar 2017 14:59:23 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: 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 Content-Length: 1436 Lines: 39 On 03/13/2017 02:29 PM, Rob Clark wrote: > On Mon, Mar 13, 2017 at 5:09 PM, Laura Abbott wrote: >>> Hm, we might want to expose all the heaps as individual >>> /dev/ion_$heapname nodes? Should we do this from the start, since >>> we're massively revamping the uapi anyway (imo not needed, current >>> state seems to work too)? >>> -Daniel >>> >> >> I thought about that. One advantage with separate /dev/ion_$heap >> is that we don't have to worry about a limit of 32 possible >> heaps per system (32-bit heap id allocation field). But dealing >> with an ioctl seems easier than names. Userspace might be less >> likely to hardcode random id numbers vs. names as well. > > > other advantage, I think, is selinux (brought up elsewhere on this > thread).. heaps at known fixed PAs are useful for certain sorts of > attacks so being able to restrict access more easily seems like a good > thing > > BR, > -R > Some other kind of filtering (BPF/LSM/???) might work as well (http://kernsec.org/files/lss2015/vanderstoep.pdf ?) The fixed PA issue is a larger problem. We're never going to be able to get away from "this heap must exist at address X" problems but the location of CMA in general should be randomized. I haven't actually come up with a good proposal to this though. I'd like for Ion to be a framework for memory allocation and not security exploits. Hopefully this isn't a pipe dream. Thanks, Laura