Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Feb 2020 21:44:00 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r358253 - in stable: 11/usr.bin/kdump 12/usr.bin/kdump
Message-ID:  <202002222144.01MLi0rK072859@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Sat Feb 22 21:44:00 2020
New Revision: 358253
URL: https://svnweb.freebsd.org/changeset/base/358253

Log:
  MFC r358109: kdump: decode SHM_ANON as first arg to legacy shm_open(2)
  
  The first argument to shm_open(2) as well as shm_open2(2) may be a path or
  SHM_ANON. Decode SHM_ANON, at least- paths will show up as namei results in
  kdump output, which may be sufficient; in those cases, we'll have printed an
  address.

Modified:
  stable/12/usr.bin/kdump/kdump.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/usr.bin/kdump/kdump.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/usr.bin/kdump/kdump.c
==============================================================================
--- stable/12/usr.bin/kdump/kdump.c	Sat Feb 22 20:50:30 2020	(r358252)
+++ stable/12/usr.bin/kdump/kdump.c	Sat Feb 22 21:44:00 2020	(r358253)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/uio.h>
 #include <sys/event.h>
 #include <sys/ktrace.h>
+#include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
@@ -1247,7 +1248,12 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags)
 				narg--;
 				break;
 			case SYS_shm_open:
-				print_number(ip, narg, c);
+				if (ip[0] == (uintptr_t)SHM_ANON) {
+					printf("(SHM_ANON");
+					ip++;
+				} else {
+					print_number(ip, narg, c);
+				}
 				putchar(',');
 				print_mask_arg(sysdecode_open_flags, ip[0]);
 				putchar(',');



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002222144.01MLi0rK072859>