do malloc trim after load policy
This commit is contained in:
parent
c214346bb9
commit
3f2f48423b
35
do-malloc-trim-after-load-policy.patch
Normal file
35
do-malloc-trim-after-load-policy.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From 3d5049f849226d54070651fdf96019d263c38363 Mon Sep 17 00:00:00 2001
|
||||||
|
From: luhuaxin <1539327763@qq.com>
|
||||||
|
Date: Wed, 2 Jun 2021 16:24:47 +0800
|
||||||
|
Subject: [PATCH] do malloc trim after load policy
|
||||||
|
|
||||||
|
---
|
||||||
|
src/load_policy.c | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/load_policy.c b/src/load_policy.c
|
||||||
|
index 2aea826..ace898c 100644
|
||||||
|
--- a/src/load_policy.c
|
||||||
|
+++ b/src/load_policy.c
|
||||||
|
@@ -18,6 +18,7 @@
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include "policy.h"
|
||||||
|
#include <limits.h>
|
||||||
|
+#include <malloc.h>
|
||||||
|
|
||||||
|
#ifndef MNT_DETACH
|
||||||
|
#define MNT_DETACH 2
|
||||||
|
@@ -365,7 +366,9 @@ int selinux_init_load_policy(int *enforce)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Load the policy. */
|
||||||
|
- return selinux_mkload_policy(0);
|
||||||
|
+ rc = selinux_mkload_policy(0);
|
||||||
|
+ malloc_trim(0);
|
||||||
|
+ return rc;
|
||||||
|
|
||||||
|
noload:
|
||||||
|
/*
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
@ -3,12 +3,13 @@
|
|||||||
|
|
||||||
Name: libselinux
|
Name: libselinux
|
||||||
Version: 3.1
|
Version: 3.1
|
||||||
Release: 2
|
Release: 3
|
||||||
License: Public Domain
|
License: Public Domain
|
||||||
Summary: SELinux library and simple utilities
|
Summary: SELinux library and simple utilities
|
||||||
Url: https://github.com/SELinuxProject/selinux/wiki
|
Url: https://github.com/SELinuxProject/selinux/wiki
|
||||||
Source0: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180524/libselinux-3.1.tar.gz
|
Source0: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180524/libselinux-3.1.tar.gz
|
||||||
Patch0: Fix-import-error-in-python2-package.patch
|
Patch0: Fix-import-error-in-python2-package.patch
|
||||||
|
Patch1: do-malloc-trim-after-load-policy.patch
|
||||||
|
|
||||||
BuildRequires: gcc python3-devel systemd swig pcre2-devel xz-devel
|
BuildRequires: gcc python3-devel systemd swig pcre2-devel xz-devel
|
||||||
BuildRequires: python2-devel ruby-devel libsepol-static >= %{libsepol_version}
|
BuildRequires: python2-devel ruby-devel libsepol-static >= %{libsepol_version}
|
||||||
@ -144,6 +145,9 @@ mv %{buildroot}%{_sbindir}/getconlist %{buildroot}%{_sbindir}/selinuxconlist
|
|||||||
%{_mandir}/ru/man8/*
|
%{_mandir}/ru/man8/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jul 2 2021 luhuaxin <1539327763@qq.com> - 3.1-3
|
||||||
|
- do malloc trim after load policy
|
||||||
|
|
||||||
* Thu May 13 2021 weidong<weidong@uniontech.com> - 3.1-2
|
* Thu May 13 2021 weidong<weidong@uniontech.com> - 3.1-2
|
||||||
- Fix import error in python2-selinux
|
- Fix import error in python2-selinux
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user