import procps-ng-3.3.17-11.el9

This commit is contained in:
CentOS Sources 2023-05-09 05:39:04 +00:00 committed by Stepan Oksanichenko
parent ffaa3357f0
commit 5c6a59155f
3 changed files with 82 additions and 1 deletions

View File

@ -0,0 +1,44 @@
diff -up ./ps/display.c.ori ./ps/display.c
--- ./ps/display.c.ori 2021-02-09 11:11:25.000000000 +0100
+++ ./ps/display.c 2022-11-29 18:39:13.254573784 +0100
@@ -44,6 +44,8 @@
#define SIGCHLD SIGCLD
#endif
+#define SIG_IS_TERM_OR_HUP(signo) (((signo) == SIGTERM) || (signo) == SIGHUP)
+
char *myname;
/* just reports a crash */
@@ -54,20 +56,23 @@ static void signal_handler(int signo){
sigprocmask(SIG_BLOCK, &ss, NULL);
if(signo==SIGPIPE) _exit(0); /* "ps | head" will cause this */
/* fprintf() is not reentrant, but we _exit() anyway */
- fprintf(stderr,
- _("Signal %d (%s) caught by %s (%s).\n"),
- signo,
- signal_number_to_name(signo),
- myname,
- PACKAGE_VERSION
- );
+ if (!SIG_IS_TERM_OR_HUP(signo)) {
+ fprintf(stderr,
+ _("Signal %d (%s) caught by %s (%s).\n"),
+ signo,
+ signal_number_to_name(signo),
+ myname,
+ PACKAGE_VERSION
+ );
+ }
switch (signo) {
case SIGHUP:
case SIGUSR1:
case SIGUSR2:
exit(EXIT_FAILURE);
default:
- error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug"));
+ if (!SIG_IS_TERM_OR_HUP(signo))
+ error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug"));
signal(signo, SIG_DFL); /* allow core file creation */
sigemptyset(&ss);
sigaddset(&ss, signo);

View File

@ -0,0 +1,23 @@
diff --git a/ps/display.c b/ps/display.c
index 1927fd6..e7ab351 100644
--- a/ps/display.c
+++ b/ps/display.c
@@ -357,7 +357,7 @@ static void simple_spew(void){
if (selection_list && selection_list->typecode == SEL_PID_QUICK) {
flags |= PROC_PID;
- pidlist = (pid_t*) malloc(selection_list->n * sizeof(pid_t));
+ pidlist = (pid_t*) malloc((selection_list->n + 1) * sizeof(pid_t));
if (!pidlist) {
fprintf(stderr, _("error: not enough memory\n"));
exit(1);
@@ -366,6 +366,9 @@ static void simple_spew(void){
for (i = 0; i < selection_list->n; i++) {
pidlist[i] = selection_list->u[selection_list->n-i-1].pid;
}
+
+ // delimit the array with nul object (0); RHBZ#2153813
+ pidlist[selection_list->n] = (pid_t)0;
}
ptp = openproc(flags, pidlist);

View File

@ -4,7 +4,7 @@
Summary: System and process monitoring utilities
Name: procps-ng
Version: 3.3.17
Release: 8%{?dist}
Release: 11%{?dist}
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
URL: https://sourceforge.net/projects/procps-ng/
@ -22,6 +22,8 @@ Patch4: free-new-used-calc.patch
Patch5: sysctl-support-systemd-globs.patch
Patch6: sysctl-print-dotted-keys-again.patch
Patch7: pgrep-uid-gid-overflow-backport.patch
Patch8: display-sig-unsafe.patch
Patch9: ps-out-of-bonds-read.patch
BuildRequires: make
@ -165,6 +167,18 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof
%files i18n -f %{name}.lang
%changelog
* Thu Jan 26 2023 Jan Rybar <jrybar@redhat.com> - 3.3.17-11
- version bump requested to create -devel subpkg for CRB inclusion
- Resolves: rhbz#2158253
* Wed Jan 18 2023 Jan Rybar <jrybar@redhat.com> - 3.3.17-10
- ps: out-of-bonds read in quick mode
- Resolves: rhbz#2161648
* Tue Nov 29 2022 Jan Rybar <jrybar@redhat.com> - 3.3.17-9
- display.c: backport: async-signal-unsafe handler deadlocks on SIGHUP
- Resolves: rhbz#2141697
* Thu Aug 18 2022 Jan Rybar <jrybar@redhat.com> - 3.3.17-8
- pgrep: uid/gid overflow fix backport
- Resolves: rhbz#2119083