diff --git a/0001-killall-match-on-16-character-commlen-too.patch b/0001-killall-match-on-16-character-commlen-too.patch new file mode 100644 index 0000000..0622b73 --- /dev/null +++ b/0001-killall-match-on-16-character-commlen-too.patch @@ -0,0 +1,122 @@ +From 1188315cd037d73bf946a0003b70c6423cc330d2 Mon Sep 17 00:00:00 2001 +From: Craig Small +Date: Wed, 7 Nov 2018 20:13:09 +1100 +Subject: [PATCH 01/11] killall: match on 16 character commlen too + +The comm length increase meant killall could accomodate the +larger comm name given out by newer kernels but it meant that +if a user relied on the previous 16 character truncation then +processes that used to match would fail. + +killall now checks to see if the the comm is the old COMM_LEN +length and the given name is longer than old COMM_LEN and does +a truncated match as well. + +References: + https://bugs.debian.org/912748 +--- + ChangeLog | 3 +++ + src/killall.c | 69 +++++++++++++++++++++++++++++++++++---------------- + 2 files changed, 50 insertions(+), 22 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 7fd2abd..37962cb 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,6 @@ ++Changes in 23.4 ++=============== ++ * killall: check also truncated 16 char comm names Debian #912748 + Changes in 23.2 + =============== + * misc: Command names increased from 16 to 64 characters +diff --git a/src/killall.c b/src/killall.c +index 2715515..09212a4 100644 +--- a/src/killall.c ++++ b/src/killall.c +@@ -492,6 +492,49 @@ create_pid_table(int *max_pids, int *pids) + return pid_table; + } + ++#define strcmp2(A,B,I) (I? strcasecmp((A),(B)):strcmp((A),(B))) ++#define strncmp2(A,B,L,I) (I? strncasecmp((A),(B),(L)):strncmp((A),(B),(L))) ++static int match_process_name( ++ const char *proc_comm, ++ const int comm_len, ++ const char *proc_cmdline, ++ const char *match_name, ++ const int match_len, ++ const int got_long ++ ) ++{ ++ /* process is old length but matching longer */ ++ if (comm_len == OLD_COMM_LEN - 1 && match_len >= OLD_COMM_LEN - 1) ++ { ++ if (got_long) ++ { ++ return (0 == strncmp2 (match_name, proc_cmdline, OLD_COMM_LEN - 1, ++ ignore_case)); ++ } else { ++ return (0 == strncmp2 (match_name, proc_comm, OLD_COMM_LEN - 1, ++ ignore_case)); ++ } ++ } ++ ++ if (comm_len == COMM_LEN - 1 && match_len >= COMM_LEN - 1) ++ { ++ if (got_long) ++ { ++ return (0 == strncmp2 (match_name, proc_cmdline, COMM_LEN - 1, ++ ignore_case)); ++ } else { ++ return (0 == strncmp2 (match_name, proc_comm, COMM_LEN - 1, ++ ignore_case)); ++ } ++ } ++ /* Not old new COMM_LEN so we match all of it */ ++ if (got_long) ++ { ++ return (0 == strcmp2 (match_name, proc_cmdline, ignore_case)); ++ } ++ return (0 == strcmp2 (match_name, proc_comm, ignore_case)); ++} ++ + #ifdef WITH_SELINUX + static int + kill_all(int signal, int name_count, char **namelist, struct passwd *pwent, +@@ -599,28 +642,10 @@ kill_all (int signal, int name_count, char **namelist, struct passwd *pwent) + { + if (!name_info[j].st.st_dev) + { +- if (length != COMM_LEN - 1 || name_info[j].name_length < COMM_LEN - 1) +- { +- if (ignore_case == 1) +- { +- if (strcasecmp (namelist[j], comm)) +- continue; +- } else { +- if (strcmp(namelist[j], comm)) +- continue; +- } +- } else { +- if (ignore_case == 1) +- { +- if (got_long ? strcasecmp (namelist[j], command) : +- strncasecmp (namelist[j], comm, COMM_LEN - 1)) +- continue; +- } else { +- if (got_long ? strcmp (namelist[j], command) : +- strncmp (namelist[j], comm, COMM_LEN - 1)) +- continue; +- } +- } ++ if (!match_process_name(comm, length, command, namelist[j], ++ name_info[j].name_length, got_long)) ++ continue; ++ + } else { + int ok = 1; + if (asprintf (&path, PROC_BASE "/%d/exe", pid_table[i]) < 0) +-- +2.20.1 + diff --git a/0002-misc-Remember-to-add-comm.h-too.patch b/0002-misc-Remember-to-add-comm.h-too.patch new file mode 100644 index 0000000..6281cdd --- /dev/null +++ b/0002-misc-Remember-to-add-comm.h-too.patch @@ -0,0 +1,28 @@ +From e2cf9f3e83e0fc0278ff39a4dfc8e3f2730eebca Mon Sep 17 00:00:00 2001 +From: Craig Small +Date: Wed, 7 Nov 2018 20:19:38 +1100 +Subject: [PATCH 02/11] misc: Remember to add comm.h too + +The previous commit should have included comm.h too +--- + src/comm.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/comm.h b/src/comm.h +index b54b998..b10eb36 100644 +--- a/src/comm.h ++++ b/src/comm.h +@@ -33,4 +33,10 @@ + */ + #define COMM_LEN 64 + ++/* ++ * Older kernels had only 16 characters, which means we may have to check this ++ * too ++ */ ++#define OLD_COMM_LEN 16 ++ + #endif +-- +2.20.1 + diff --git a/0003-Makefile.am-create-src-before-src-signames.h.patch b/0003-Makefile.am-create-src-before-src-signames.h.patch new file mode 100644 index 0000000..4ca7a9d --- /dev/null +++ b/0003-Makefile.am-create-src-before-src-signames.h.patch @@ -0,0 +1,29 @@ +From b7dc1c5eb9459f83b2355c8f061933c74b71c724 Mon Sep 17 00:00:00 2001 +From: Michael Stapelberg +Date: Sun, 14 Oct 2018 16:07:23 +0200 +Subject: [PATCH 03/11] Makefile.am: create src/ before src/signames.h + +This fixes out-of-tree builds which use +--disable-dependency-tracking. With dependency tracking enabled, +src/.deps is created as a side-effect of how dependency tracking +works, which is why this issue was never noticed before. +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index d8c4619..8859818 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -79,7 +79,7 @@ EXTRA_DIST = src/signames.c README.md misc/git-version-gen + + CLEANFILES = src/signames.h + +-src/signames.h: src/signames.c Makefile ++src/signames.h: src/signames.c Makefile src/$(am__dirstamp) + export LC_ALL=C ; \ + @CPP@ -dM $< |\ + tr -s '\t ' ' ' | sort -n -k 3 | sed \ +-- +2.20.1 + diff --git a/no-nullptr-sanity-stalls-nfs.patch b/0004-NULLptr-sanity-added-in-scan-fns-to-avoid-useless-pr.patch similarity index 94% rename from no-nullptr-sanity-stalls-nfs.patch rename to 0004-NULLptr-sanity-added-in-scan-fns-to-avoid-useless-pr.patch index 718ec53..3b24de1 100644 --- a/no-nullptr-sanity-stalls-nfs.patch +++ b/0004-NULLptr-sanity-added-in-scan-fns-to-avoid-useless-pr.patch @@ -1,8 +1,8 @@ From 499dfe62817f46e2132dd265dbe3603e5929279e Mon Sep 17 00:00:00 2001 From: Jan Rybar Date: Tue, 19 Feb 2019 16:39:17 +0100 -Subject: [PATCH] NULLptr sanity added in scan fns to avoid useless prep work - (stalls NFS) +Subject: [PATCH 04/11] NULLptr sanity added in scan fns to avoid useless prep + work (stalls NFS) --- src/fuser.c | 14 ++++++++++++++ diff --git a/0005-changelog-Add-note-for-18.patch b/0005-changelog-Add-note-for-18.patch new file mode 100644 index 0000000..a810dc2 --- /dev/null +++ b/0005-changelog-Add-note-for-18.patch @@ -0,0 +1,24 @@ +From d055680b41a2ca9a195e450bbc41728efc8d4f86 Mon Sep 17 00:00:00 2001 +From: Craig Small +Date: Thu, 9 May 2019 21:22:15 +1000 +Subject: [PATCH 05/11] changelog: Add note for !18 + +--- + ChangeLog | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/ChangeLog b/ChangeLog +index 37962cb..1ad8967 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + Changes in 23.4 + =============== + * killall: check also truncated 16 char comm names Debian #912748 ++ * fuser: Return early if have nulls !18 + Changes in 23.2 + =============== + * misc: Command names increased from 16 to 64 characters +-- +2.20.1 + diff --git a/0006-This-patch-is-to-Add-ARM64-support-to-peekfd.patch b/0006-This-patch-is-to-Add-ARM64-support-to-peekfd.patch new file mode 100644 index 0000000..d0bb985 --- /dev/null +++ b/0006-This-patch-is-to-Add-ARM64-support-to-peekfd.patch @@ -0,0 +1,236 @@ +From 32432ef9bbb44ea74d4dae858786db75c082623f Mon Sep 17 00:00:00 2001 +From: akaher +Date: Tue, 16 Apr 2019 13:50:08 +0000 +Subject: [PATCH 06/11] This patch is to 'Add ARM64 support to peekfd'. + +ARM64 copy user_pt_regs to user space instead of pt_regs. +So in this patch, mapping the require user_pt_regs except orig_x0, +as orig_x0 not available in user_pt_regs for SYSCALL exit. + +For each SYSCALL, peekfd catches user_pt_regs for SYSCALL entry/exit. +Value of orig_x0 is available in user_pt_regs->x0 of SYSCALL entry. + +So to get orig_x0, stores user_pt_regs of SYSCALL entry, +and then compare 'fd and addr of buffer' of SYSCALL exit +with SYSCALL entry to retrive orig_x0 at the time of SYSCALL exit. + +Signed-off-by: Ajay Kaher +--- + Makefile.am | 6 +++ + configure.ac | 3 ++ + src/peekfd.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++-- + 3 files changed, 118 insertions(+), 3 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 8859818..441ae94 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -40,6 +40,12 @@ if WANT_PEEKFD_ARM + bin_PROGRAMS += src/peekfd + AM_CPPFLAGS += -DARM + endif ++ ++if WANT_PEEKFD_ARM64 ++ bin_PROGRAMS += src/peekfd ++ AM_CPPFLAGS += -DARM64 ++endif ++ + if WANT_PEEKFD_MIPS + bin_PROGRAMS += src/peekfd + AM_CPPFLAGS += -DMIPS +diff --git a/configure.ac b/configure.ac +index 176a2fc..407cd97 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -131,6 +131,7 @@ AC_CHECK_MEMBERS([struct user_regs_struct.orig_eax, + AC_CHECK_MEMBERS([struct pt_regs.orig_gpr3, + struct pt_regs.gpr], [],[], [#include ]) + AC_CHECK_MEMBERS([struct pt_regs.uregs],[],[], [#include ]) ++AC_CHECK_MEMBERS([struct user_pt_regs.regs],[],[], [#include ]) + AC_CHECK_MEMBERS([struct pt_regs.regs, + struct pt_regs.cp0_status],[],[], [#include ]) + AC_CHECK_MEMBERS([struct pt_regs.orig_d0, +@@ -163,6 +164,8 @@ AM_CONDITIONAL(WANT_PEEKFD_PPC, + test $ac_cv_member_struct_pt_regs_gpr = yes ) + AM_CONDITIONAL(WANT_PEEKFD_ARM, + test $ac_cv_member_struct_pt_regs_uregs = yes) ++AM_CONDITIONAL(WANT_PEEKFD_ARM64, ++ test $ac_cv_member_struct_user_pt_regs_regs = yes) + AM_CONDITIONAL(WANT_PEEKFD_MIPS, + test $build_cpu = mipsel && + test $ac_cv_member_struct_pt_regs_regs = yes && +diff --git a/src/peekfd.c b/src/peekfd.c +index 5aa990a..f41391a 100644 +--- a/src/peekfd.c ++++ b/src/peekfd.c +@@ -35,9 +35,17 @@ + #include + #include + #include ++#include ++#include ++#include + + #include "i18n.h" + ++#ifdef ARM64 ++#include ++#include ++#endif ++ + #ifdef I386 + #define REG_ORIG_ACCUM orig_eax + #define REG_ACCUM eax +@@ -72,6 +80,16 @@ + #define REG_PARAM1 ARM_ORIG_r0 + #define REG_PARAM2 ARM_r1 + #define REG_PARAM3 ARM_r2 ++ ++#elif defined(ARM64) ++ #define REG_ORIG_ACCUM regs[8] ++ #define REG_ACCUM regs[0] ++ #define REG_PARAM1 regs[0] ++ #define REG_PARAM2 regs[1] ++ #define REG_PARAM3 regs[2] ++ ++ ++ + #elif defined(MIPS) + #ifndef MIPSEL + #error only little endian supported +@@ -94,6 +112,59 @@ int num_attached_pids = 0; + pid_t attached_pids[MAX_ATTACHED_PIDS]; + int *fds = NULL; + ++#ifdef ARM64 ++struct user_pt_regs_node { ++ struct user_pt_regs regs; ++ struct user_pt_regs_node *user_pt_regs_next; ++}; ++ ++void user_pt_regs_insert(struct user_pt_regs_node** user_pt_regs_head, struct user_pt_regs *regs) ++{ ++ struct user_pt_regs_node* new_node = ++ (struct user_pt_regs_node*) malloc(sizeof(struct user_pt_regs_node)); ++ ++ memcpy(&new_node->regs, regs, sizeof(struct user_pt_regs)); ++ new_node->user_pt_regs_next = (*user_pt_regs_head); ++ (*user_pt_regs_head) = new_node; ++} ++ ++struct user_pt_regs * user_pt_regs_search(struct user_pt_regs_node** user_pt_regs_head, struct user_pt_regs *regs) ++{ ++ struct user_pt_regs_node* current = *user_pt_regs_head; ++ while (current != NULL) ++ { ++ if ((current->regs.REG_ORIG_ACCUM == regs->REG_ORIG_ACCUM) && (current->regs.REG_PARAM2 == regs->REG_PARAM2)) ++ return ¤t->regs; ++ current = current->user_pt_regs_next; ++ } ++ return NULL; ++} ++ ++ ++int user_pt_regs_delete(struct user_pt_regs_node** user_pt_regs_head, struct user_pt_regs *regs) ++{ ++ struct user_pt_regs_node* temp = *user_pt_regs_head, *prev; ++ ++ if (temp != NULL && (&temp->regs == regs)) ++ { ++ *user_pt_regs_head = temp->user_pt_regs_next; ++ free(temp); ++ return 0; ++ } ++ ++ while (temp != NULL && (&temp->regs != regs)) ++ { ++ prev = temp; ++ temp = temp->user_pt_regs_next; ++ } ++ ++ if (temp == NULL) return -1; ++ prev->user_pt_regs_next = temp->user_pt_regs_next; ++ free(temp); ++ return 0; ++} ++#endif ++ + void detach(int signum) { + int i; + for (i = 0; i < num_attached_pids; i++) +@@ -260,6 +331,10 @@ int main(int argc, char **argv) + unsigned char *lastbuf = NULL; + unsigned long last_buf_size = -1; + ++#ifdef ARM64 ++ struct user_pt_regs_node* user_pt_regs_head = NULL; ++#endif ++ + for(;;) { + int status; + pid_t pid = wait(&status); +@@ -274,6 +349,18 @@ int main(int argc, char **argv) + #elif defined(ARM) + struct pt_regs regs; + ptrace(PTRACE_GETREGS, pid, 0, ®s); ++ ++#elif defined(ARM64) ++ struct user_pt_regs regs, *old_regs; ++ struct iovec io; ++ io.iov_base = ®s; ++ io.iov_len = sizeof(regs); ++ ++ if (ptrace(PTRACE_GETREGSET, pid, (void*) NT_PRSTATUS, (void*) &io) == -1) { ++ printf("ARM64: PTRACE_GETREGSET: %s\n", strerror(errno)); ++ return errno; ++ } ++ + #elif defined(MIPS) + struct pt_regs regs; + long pc = ptrace(PTRACE_PEEKUSER, pid, 64, 0); +@@ -287,12 +374,26 @@ int main(int argc, char **argv) + ptrace(PTRACE_GETREGS, pid, 0, ®s); + #endif + /*unsigned int b = ptrace(PTRACE_PEEKTEXT, pid, regs.eip, 0);*/ +- if ((follow_forks && regs.REG_ORIG_ACCUM == SYS_fork) +- || (follow_clones && regs.REG_ORIG_ACCUM == SYS_clone)) { ++ ++#if defined(ARM64) ++ if (follow_forks && regs.REG_ORIG_ACCUM == SYS_clone) { ++#else ++ if ((follow_forks && regs.REG_ORIG_ACCUM == SYS_fork) ++ || (follow_clones && regs.REG_ORIG_ACCUM == SYS_clone)) { ++#endif + if (regs.REG_ACCUM > 0) + attach(regs.REG_ACCUM); + } + if ((regs.REG_ORIG_ACCUM == SYS_read || regs.REG_ORIG_ACCUM == SYS_write) && (regs.REG_PARAM3 == regs.REG_ACCUM)) { ++#ifdef ARM64 ++ /* ARM64 doesn't expose orig_x0 to user space, ++ so retrive orig_x0 from older user pt regs */ ++ old_regs = user_pt_regs_search(&user_pt_regs_head, ®s); ++ if (old_regs != NULL) { ++ regs.REG_PARAM1 = old_regs->REG_PARAM1; ++ user_pt_regs_delete(&user_pt_regs_head, old_regs); ++ } ++#endif + for (i = 0; i < numfds; i++) + if (fds[i] == (int)regs.REG_PARAM1) + break; +@@ -348,7 +449,12 @@ int main(int argc, char **argv) + fflush(stdout); + } + } +- ++#ifdef ARM64 ++ else if (regs.REG_ORIG_ACCUM == SYS_read || regs.REG_ORIG_ACCUM == SYS_write) ++ { ++ user_pt_regs_insert(&user_pt_regs_head,®s); ++ } ++#endif + ptrace(PTRACE_SYSCALL, pid, 0, 0); + } + } +-- +2.20.1 + diff --git a/0007-changelog-Add-note-for-psmisc-psmisc-19.patch b/0007-changelog-Add-note-for-psmisc-psmisc-19.patch new file mode 100644 index 0000000..f130db8 --- /dev/null +++ b/0007-changelog-Add-note-for-psmisc-psmisc-19.patch @@ -0,0 +1,24 @@ +From 0f35d29fc90d9eb56d0370366f075339918efa62 Mon Sep 17 00:00:00 2001 +From: Craig Small +Date: Thu, 9 May 2019 21:28:34 +1000 +Subject: [PATCH 07/11] changelog: Add note for psmisc/psmisc!19 + +--- + ChangeLog | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/ChangeLog b/ChangeLog +index 1ad8967..f7037bd 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -2,6 +2,7 @@ Changes in 23.4 + =============== + * killall: check also truncated 16 char comm names Debian #912748 + * fuser: Return early if have nulls !18 ++ * peekfd: Add support for ARM64 + Changes in 23.2 + =============== + * misc: Command names increased from 16 to 64 characters +-- +2.20.1 + diff --git a/0008-changelog-put-in-merge-request.patch b/0008-changelog-put-in-merge-request.patch new file mode 100644 index 0000000..f5c857c --- /dev/null +++ b/0008-changelog-put-in-merge-request.patch @@ -0,0 +1,25 @@ +From d36663a3ba6fbd1a878328308135f7b77570865e Mon Sep 17 00:00:00 2001 +From: Craig Small +Date: Thu, 9 May 2019 21:29:11 +1000 +Subject: [PATCH 08/11] changelog: put in merge request + +--- + ChangeLog | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index f7037bd..66a8e88 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -2,7 +2,7 @@ Changes in 23.4 + =============== + * killall: check also truncated 16 char comm names Debian #912748 + * fuser: Return early if have nulls !18 +- * peekfd: Add support for ARM64 ++ * peekfd: Add support for ARM64 !19 + Changes in 23.2 + =============== + * misc: Command names increased from 16 to 64 characters +-- +2.20.1 + diff --git a/0009-pstree-initialize-pid_set.patch b/0009-pstree-initialize-pid_set.patch new file mode 100644 index 0000000..6ab7066 --- /dev/null +++ b/0009-pstree-initialize-pid_set.patch @@ -0,0 +1,25 @@ +From 8a9d81dbbf3fc8159920335777d862d543995499 Mon Sep 17 00:00:00 2001 +From: Vladislav Ivanishin +Date: Thu, 6 Jun 2019 19:28:20 +0300 +Subject: [PATCH 09/11] pstree: initialize pid_set + +--- + src/pstree.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/pstree.c b/src/pstree.c +index aaf3df7..e4fed4d 100644 +--- a/src/pstree.c ++++ b/src/pstree.c +@@ -1148,7 +1148,7 @@ int main(int argc, char **argv) + pid_t pid, highlight; + char termcap_area[1024]; + char *termname, *endptr; +- int c, pid_set; ++ int c, pid_set = 0; + enum ns_type nsid = NUM_NS; + + struct option options[] = { +-- +2.20.1 + diff --git a/0010-fuser-use-larger-inode-size.patch b/0010-fuser-use-larger-inode-size.patch new file mode 100644 index 0000000..8a7de47 --- /dev/null +++ b/0010-fuser-use-larger-inode-size.patch @@ -0,0 +1,89 @@ +From 0a1cd72ba107b0b06b60af94853589fb5e0e7b1e Mon Sep 17 00:00:00 2001 +From: Craig Small +Date: Mon, 24 Jun 2019 22:16:54 +1000 +Subject: [PATCH 10/11] fuser: use larger inode size + +Scanned inodes now are unsigned long long. +Thanks to... anon! + +References: + psmisc/psmisc#16 +--- + ChangeLog | 1 + + src/fuser.c | 13 +++++++------ + 2 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 66a8e88..77b842f 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -3,6 +3,7 @@ Changes in 23.4 + * killall: check also truncated 16 char comm names Debian #912748 + * fuser: Return early if have nulls !18 + * peekfd: Add support for ARM64 !19 ++ * fuser: Use larger inode sizes #16 + Changes in 23.2 + =============== + * misc: Command names increased from 16 to 64 characters +diff --git a/src/fuser.c b/src/fuser.c +index b8662a3..db00c78 100644 +--- a/src/fuser.c ++++ b/src/fuser.c +@@ -703,7 +703,8 @@ find_net_sockets(struct inode_list **ino_list, + FILE *fp; + char pathname[200], line[BUFSIZ]; + unsigned long loc_port, rmt_port; +- unsigned long rmt_addr, scanned_inode; ++ unsigned long rmt_addr; ++ unsigned long long scanned_inode; + ino_t inode; + struct ip_connections *conn_tmp; + +@@ -718,7 +719,7 @@ find_net_sockets(struct inode_list **ino_list, + while (fgets(line, BUFSIZ, fp) != NULL) { + if (sscanf + (line, +- "%*u: %*x:%lx %08lx:%lx %*x %*x:%*x %*x:%*x %*x %*d %*d %lu", ++ "%*u: %*x:%lx %08lx:%lx %*x %*x:%*x %*x:%*x %*x %*d %*d %llu", + &loc_port, &rmt_addr, &rmt_port, &scanned_inode) != 4) + continue; + #ifdef DEBUG +@@ -769,7 +770,7 @@ find_net6_sockets(struct inode_list **ino_list, + unsigned int tmp_addr[4]; + char rmt_addr6str[INET6_ADDRSTRLEN]; + struct ip6_connections *conn_tmp; +- unsigned long scanned_inode; ++ unsigned long long scanned_inode; + ino_t inode; + + if (snprintf(pathname, 200, "/proc/net/%s6", protocol) < 0) +@@ -785,7 +786,7 @@ find_net6_sockets(struct inode_list **ino_list, + while (fgets(line, BUFSIZ, fp) != NULL) { + if (sscanf + (line, +- "%*u: %*x:%lx %08x%08x%08x%08x:%lx %*x %*x:%*x %*x:%*x %*x %*d %*d %lu", ++ "%*u: %*x:%lx %08x%08x%08x%08x:%lx %*x %*x:%*x %*x:%*x %*x %*d %*d %llu", + &loc_port, &(tmp_addr[0]), &(tmp_addr[1]), &(tmp_addr[2]), + &(tmp_addr[3]), &rmt_port, &scanned_inode) != 7) + continue; +@@ -1702,7 +1703,7 @@ void fill_unix_cache(struct unixsocket_list **unixsocket_head) + { + FILE *fp; + char line[BUFSIZ]; +- int scanned_inode; ++ unsigned long long scanned_inode; + struct stat st; + struct unixsocket_list *newsocket; + +@@ -1714,7 +1715,7 @@ void fill_unix_cache(struct unixsocket_list **unixsocket_head) + while (fgets(line, BUFSIZ, fp) != NULL) { + char *path; + char *scanned_path = NULL; +- if (sscanf(line, "%*x: %*x %*x %*x %*x %*d %d %ms", ++ if (sscanf(line, "%*x: %*x %*x %*x %*x %*d %llu %ms", + &scanned_inode, &scanned_path) != 2) { + if (scanned_path) + free(scanned_path); +-- +2.20.1 + diff --git a/psmisc.spec b/psmisc.spec index 06354e9..f12b83a 100644 --- a/psmisc.spec +++ b/psmisc.spec @@ -2,7 +2,7 @@ Summary: Utilities for managing processes on your system Name: psmisc Version: 23.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://gitlab.com/psmisc/psmisc @@ -10,7 +10,17 @@ Source: https://sourceforge.net/projects/%{name}/files/%{name}/%{name}-%{version #The following has been reworked by upstream in a different way ... we'll see #Patch1: psmisc-22.13-fuser-silent.patch -Patch2: no-nullptr-sanity-stalls-nfs.patch +Patch1: 0001-killall-match-on-16-character-commlen-too.patch +Patch2: 0002-misc-Remember-to-add-comm.h-too.patch +Patch3: 0003-Makefile.am-create-src-before-src-signames.h.patch +Patch4: 0004-NULLptr-sanity-added-in-scan-fns-to-avoid-useless-pr.patch +Patch5: 0005-changelog-Add-note-for-18.patch +Patch6: 0006-This-patch-is-to-Add-ARM64-support-to-peekfd.patch +Patch7: 0007-changelog-Add-note-for-psmisc-psmisc-19.patch +Patch8: 0008-changelog-put-in-merge-request.patch +Patch9: 0009-pstree-initialize-pid_set.patch +Patch10: 0010-fuser-use-larger-inode-size.patch + BuildRequires: libselinux-devel BuildRequires: gettext @@ -49,6 +59,7 @@ mv $RPM_BUILD_ROOT%{_bindir}/fuser $RPM_BUILD_ROOT%{_sbindir} %files -f %{name}.lang %{_sbindir}/fuser %{_bindir}/killall +%{_bindir}/peekfd %{_bindir}/pstree %{_bindir}/pstree.x11 %{_bindir}/prtstat @@ -58,17 +69,16 @@ mv $RPM_BUILD_ROOT%{_bindir}/fuser $RPM_BUILD_ROOT%{_sbindir} %{_mandir}/man1/pstree.1* %{_mandir}/man1/prtstat.1* %{_mandir}/man1/pslog.1* -%ifarch %{ix86} x86_64 ppc %{power64} %{arm} mipsel -%{_bindir}/peekfd %{_mandir}/man1/peekfd.1* -%else -%exclude %{_mandir}/man1/peekfd.1* -%endif %license COPYING %doc AUTHORS ChangeLog README %changelog +* Mon Aug 26 2019 Jan Rybar - 23.2-2 +- Backport of upstream patches since v23.2 release +- Added support of peekfd on aarch64 + * Fri Aug 23 2019 Jan Rybar - 23.2-1 - Rebase to 23.2 with autosetup