From 4cbec4439713c3b4cfcbbe36ff40d5e4fa57492f Mon Sep 17 00:00:00 2001 From: Pawel Biernacki Date: Wed, 25 Nov 2020 16:30:57 +0000 Subject: [PATCH] libsysdecode: correctly decode mmap flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit r352913 added decoding of mmap PROT_MAX()'d flags but didn’t account for the case where different values were specified for PROT_MAX and regular flags. Fix it. Submitted by: sigsys_gmail.com Reported by: sigsys_gmail.com MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D27312 --- lib/libsysdecode/flags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsysdecode/flags.c b/lib/libsysdecode/flags.c index 5ba197438452..604303a0cbd4 100644 --- a/lib/libsysdecode/flags.c +++ b/lib/libsysdecode/flags.c @@ -662,11 +662,11 @@ sysdecode_mmap_prot(FILE *fp, int prot, int *rem) printed = false; protm = PROT_MAX_EXTRACT(prot); + prot = PROT_EXTRACT(prot); if (protm != 0) { fputs("PROT_MAX(", fp); printed = print_mask_int(fp, mmapprot, protm, rem); fputs(")|", fp); - prot = protm; } return (print_mask_int(fp, mmapprot, prot, rem) || printed); }