
centos 6.10 rpm for fix polkit CVE-2021-4034; centos 6.10的rpm包,修复CVE-2021-4034 漏洞
CentOS 7.x already has an RPM package that fixes the CVE-2021-4034 vulnerability, but I couldn't find one for CentOS 6.x. I created and packaged the RPM myself by referring to the source code
Red Hat has already fixed 6.x, but I couldn't find a download location https://access.redhat.com/errata/RHSA-2022:0269
Download polkit-0.96-11.1.el6.x86_64.rpm
Upgrade
rpm -Uhv polkit-0.96-11.1.el6.x86_64.rpm
Test whether the vulnerability is fixed
sh check_polkit_cve_2021_4034.sh
Download polkit-0.96-11.el6.src.rpm
https://vault.centos.org/6.10/os/Source/SPackages/
Install rpm -hiv polkit-0.96-11.el6.src.rpm
~/rpmbuild/SOURCES/
~/rpmbuild/SPECS/
Apply the original Patch
rpmbuild -bp ~/rpmbuild/SPECS/polkit.spec
cd ~/rpmbuild/BUILD
cp -R polkit-0.96 polkit-0.96-new
Modify pkcheck.c and pkexec.c in the polkit-0.96-new directory
Refer to https://gitlab.freedesktop.org/polkit/polkit/-/commit/a2bf5c9c83b6ae46cbd5c779d3055bff81ded683
Generate the patch
diff -uNr polkit-0.96 polkit-0.96-new/ > polkit-0.96-CVE-2021-4034.patch
Copy the patch
cp polkit-0.96-CVE-2021-4034.patch ~/rpmbuild/SOURCES/
Modify ~/rpmbuild/SPECS/polkit.spec
Compile rpmbuild -ba ~/rpmbuild/SPECS/polkit.spec
SRPMS/polkit-0.96-11.1.el6.src.rpm
RPMS/x86_64/polkit-0.96-11.1.el6.x86_64.rpm
RPMS/x86_64/polkit-debuginfo-0.96-11.1.el6.x86_64.rpm
RPMS/x86_64/polkit-devel-0.96-11.1.el6.x86_64.rpm
RPMS/x86_64/polkit-docs-0.96-11.1.el6.x86_64.rpm
RPMS/noarch/polkit-desktop-policy-0.96-11.1.el6.noarch.rpm
Install
rpm -Uhv RPMS/x86_64/polkit-0.96-11.1.el6.x86_64.rpm
Test whether the vulnerability is fixed
sh check_polkit_cve_2021_4034.sh