From owner-svn-src-all@freebsd.org Tue Mar 17 18:44:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82B2F26ECB3; Tue, 17 Mar 2020 18:44:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48hhsK0l88z3LqX; Tue, 17 Mar 2020 18:44:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C158DAF7; Tue, 17 Mar 2020 18:44:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 02HIi4Cn053170; Tue, 17 Mar 2020 18:44:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 02HIi3rl053168; Tue, 17 Mar 2020 18:44:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202003171844.02HIi3rl053168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 17 Mar 2020 18:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359047 - in head: lib/libsysdecode sys/fs/procfs sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/libsysdecode sys/fs/procfs sys/sys X-SVN-Commit-Revision: 359047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2020 18:44:05 -0000 Author: jhb Date: Tue Mar 17 18:44:03 2020 New Revision: 359047 URL: https://svnweb.freebsd.org/changeset/base/359047 Log: Mark procfs-based process debugging as deprecated for FreeBSD 13. Attempting to use ioctls on /proc//mem to control a process will trigger warnings on the console. The include file will also now emit a compile-time warning when used from userland. Reviewed by: emaste MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D23822 Modified: head/lib/libsysdecode/Makefile head/sys/fs/procfs/procfs_ioctl.c head/sys/sys/pioctl.h Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Tue Mar 17 18:17:32 2020 (r359046) +++ head/lib/libsysdecode/Makefile Tue Mar 17 18:44:03 2020 (r359047) @@ -121,6 +121,9 @@ CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} +# Ignore deprecation warning in +CFLAGS.ioctl.c+= -Wno-\#warnings + DEPENDOBJS+= tables.h tables.h: mktables sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET} Modified: head/sys/fs/procfs/procfs_ioctl.c ============================================================================== --- head/sys/fs/procfs/procfs_ioctl.c Tue Mar 17 18:17:32 2020 (r359046) +++ head/sys/fs/procfs/procfs_ioctl.c Tue Mar 17 18:44:03 2020 (r359047) @@ -69,10 +69,53 @@ procfs_ioctl(PFS_IOCTL_ARGS) #ifdef COMPAT_FREEBSD6 int ival; #endif + static struct timeval lasttime; + static struct timeval interval = { .tv_sec = 1, .tv_usec = 0 }; KASSERT(p != NULL, ("%s() called without a process", __func__)); PROC_LOCK_ASSERT(p, MA_OWNED); + + switch (cmd) { +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 1, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 1): +#endif + case PIOCBIS: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 2, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 2): +#endif + case PIOCBIC: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 3, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 3): +#endif + case PIOCSFL: + case PIOCGFL: + case PIOCWAIT: + case PIOCSTATUS: +#ifdef COMPAT_FREEBSD32 + case PIOCWAIT32: + case PIOCSTATUS32: +#endif +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 5, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 5): +#endif + case PIOCCONT: + if (ratecheck(&lasttime, &interval) != 0) + gone_in(13, "procfs-based process debugging"); + break; + } error = 0; switch (cmd) { Modified: head/sys/sys/pioctl.h ============================================================================== --- head/sys/sys/pioctl.h Tue Mar 17 18:17:32 2020 (r359046) +++ head/sys/sys/pioctl.h Tue Mar 17 18:44:03 2020 (r359047) @@ -41,6 +41,10 @@ #ifndef _SYS_PIOCTL_H # define _SYS_PIOCTL_H +#ifndef _KERNEL +#warning " is deprecated, ptrace() should be used instead" +#endif + # include struct procfs_status {