From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 16 17:27:30 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1879F1065670 for ; Sun, 16 Oct 2011 17:27:30 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5798FC0A for ; Sun, 16 Oct 2011 17:27:29 +0000 (UTC) Received: by bkbzu17 with SMTP id zu17so2816448bkb.13 for ; Sun, 16 Oct 2011 10:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:sender:date:message-id:user-agent:mime-version :content-type; bh=7hb/kpHMiotc4Y8f63duAzDrUMJwx+cY1a5DUaipnAs=; b=yGMNFcbc1Ax83DJj/0+Irl7/YNLauYvv5a5+Qp0ZMO4VzcpYTEDAX5EvyME8QdpnSg CCA++MhkDA4TniXCblWcV/Lb3SKpRROfXu5gAIeNOSfjLM58DNHDqxR7hc1Sna3D5H64 XOaosWvb33UIQcicJ5TY+yZz5IT3RXm1CIrHQ= Received: by 10.223.15.10 with SMTP id i10mr18508757faa.17.1318784281422; Sun, 16 Oct 2011 09:58:01 -0700 (PDT) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id o22sm18201921fab.11.2011.10.16.09.57.59 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Oct 2011 09:58:00 -0700 (PDT) From: Mikolaj Golub To: freebsd-hackers@freebsd.org Sender: Mikolaj Golub Date: Sun, 16 Oct 2011 19:57:57 +0300 Message-ID: <86y5wkeuw9.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Kostik Belousov , Robert Watson Subject: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2011 17:27:30 -0000 Hi, I have a patch that makes kvm_uread() read from user space using ptrace(2). http://people.freebsd.org/~trociny/kvm_uread.ptrace.patch With this change 'ps -e' does not requires procfs(5). Do you like it or there might be some reasons why it is a bad idea? Grepping sources it looks like currently only ps uses kvm_getenvv(3) (and thus kvm_uread()). Note, when reading from its own user space it just does bcopy(3), so if a wrong address range is passed to kvm_uread() the program will segfault. Do we need some protection here and what? Masking SIGSEGV? -- Mikolaj Golub