All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Conole <aconole@redhat.com>
To: "Burakov\, Anatoly" <anatoly.burakov@intel.com>
Cc: David Marchand <david.marchand@redhat.com>, dev <dev@dpdk.org>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Sebastian Scheinkman <sscheink@redhat.com>,
	dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] eal/linux: fix memory allocations in containers+SELinux
Date: Thu, 17 Sep 2020 10:44:44 -0400	[thread overview]
Message-ID: <f7timccihsz.fsf@dhcp-25.97.bos.redhat.com> (raw)
In-Reply-To: <41283b3a-5591-da2b-dea3-f069248d3265@intel.com> (Anatoly Burakov's message of "Thu, 17 Sep 2020 15:17:13 +0100")

"Burakov, Anatoly" <anatoly.burakov@intel.com> writes:

> On 17-Sep-20 2:47 PM, David Marchand wrote:
>> On Fri, Sep 11, 2020 at 2:46 PM Burakov, Anatoly
>> <anatoly.burakov@intel.com> wrote:
>>>> Removing hugepage files is done in multiple places and the memory
>>>> allocation code is complex.
>>>> This fix tries to do the minimum and avoids touching other paths.
>>>>
>>>> If trying to remove the hugepage file before allocating a page fails,
>>>> the error is reported to the caller and the user will see a memory
>>>> allocation error log.
>>>>
>>>> Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")
>>>> Cc: stable@dpdk.org
>>>>
>>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>>>> ---
>>>
>>> I believe only the primary will try to allocate new pages, but this only
>>> covers the page-per-file scenario. There's also legacy mem option (which
>>> would attempt to remove files prior to creating new ones - not sure if
>>> it's refused in that case), and single file segments option (which will
>>> mostly fallocate holes rather than delete files, but may still attempt
>>> to delete files - by the way, how does fallocate work with SELinux?).
>>
>> This issue should only concern part of the memory allocator that deals
>> with "named files" backed hugepages.
>> I would focus on the code relying on eal_get_hugefile_path() and I
>> agree I might have missed the legacy-mem part.
>>
>> For anonymous hugepages this should not matter.
>>
>>
>
> Anonymous hugepages shouldn't matter, yes, but single-file segments
> mode does fallocate() and remove - you have the remove part covered,
> but i'm just curious if fallocate() would also cause any issues with
> SELinux.

I think it might depend on the policy, file types, and labels allowed
for the process.  I did a little bit of digging but didn't find anything
that specifically targets that call.  I guess it may be something like:

  allow dom_t obj_t:file { getattr setattr appent ioctl lock open read
                           write };

BUT that's just a guess without any real testing.


  reply	other threads:[~2020-09-17 14:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10 16:24 [dpdk-dev] [PATCH] eal/linux: fix memory allocations in containers+SELinux David Marchand
2020-09-11 12:46 ` Burakov, Anatoly
2020-09-17 13:47   ` David Marchand
2020-09-17 14:17     ` Burakov, Anatoly
2020-09-17 14:44       ` Aaron Conole [this message]
2020-09-17 14:47       ` David Marchand
2020-10-02  9:36         ` David Marchand
2020-10-02 12:12           ` Burakov, Anatoly
2020-10-05 23:13             ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7timccihsz.fsf@dhcp-25.97.bos.redhat.com \
    --to=aconole@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=sscheink@redhat.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.