From: Petr Lautrbach <plautrba@redhat.com>
To: SElinux list <selinux@vger.kernel.org>,
Ondrej Mosnacek <omosnace@redhat.com>,
James Carter <jwcart2@gmail.com>
Subject: Re: [PATCH] semodule: Don't forget to munmap() data
Date: Mon, 29 Nov 2021 18:53:14 +0100 [thread overview]
Message-ID: <8735ne3l2t.fsf@redhat.com> (raw)
In-Reply-To: <CAP+JOzRQSH4Eoox3Vnh8L6WKwxHabqj1KFAEQexy3P+e3xuYaQ@mail.gmail.com>
James Carter <jwcart2@gmail.com> writes:
> On Tue, Nov 23, 2021 at 11:41 AM Petr Lautrbach <plautrba@redhat.com> wrote:
>>
>> semanage_module_extract() mmap()'s the module raw data but it leaves on
>> the caller to munmap() them.
>>
>> Reported-by: Ondrej Mosnacek <omosnace@redhat.com>
>> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
>
> Acked-by: James Carter <jwcart2@gmail.com>
Merged.
>> ---
>> policycoreutils/semodule/semodule.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/policycoreutils/semodule/semodule.c b/policycoreutils/semodule/semodule.c
>> index 57f005ce2c62..94a9d131bb79 100644
>> --- a/policycoreutils/semodule/semodule.c
>> +++ b/policycoreutils/semodule/semodule.c
>> @@ -394,6 +394,9 @@ static char *hash_module_data(const char *module_name, const int prio) {
>> sha256_buf[i * 2] = 0;
>>
>> cleanup_extract:
>> + if (data_len > 0) {
>> + munmap(data, data_len);
>> + }
>> semanage_module_info_destroy(sh, extract_info);
>> free(extract_info);
>> semanage_module_key_destroy(sh, modkey);
>> --
>> 2.33.1
>>
prev parent reply other threads:[~2021-11-29 17:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 16:38 [PATCH] semodule: Don't forget to munmap() data Petr Lautrbach
2021-11-23 17:42 ` James Carter
2021-11-29 17:53 ` Petr Lautrbach [this message]
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=8735ne3l2t.fsf@redhat.com \
--to=plautrba@redhat.com \
--cc=jwcart2@gmail.com \
--cc=omosnace@redhat.com \
--cc=selinux@vger.kernel.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.