Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754385AbZKJAAe (ORCPT ); Mon, 9 Nov 2009 19:00:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751688AbZKJAAd (ORCPT ); Mon, 9 Nov 2009 19:00:33 -0500 Received: from ey-out-2122.google.com ([74.125.78.25]:30057 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760AbZKJAAc convert rfc822-to-8bit (ORCPT ); Mon, 9 Nov 2009 19:00:32 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=KUmZ/gs2HjpO0k0i0pKkRO4snJnedJ4Tr7nKZxbA2ezwb/ebawc37n+VedRiaBVxrU QBdcOWVvbSiX6rUH0EEDxBfAo3c91Kmubf/IYAStiQNoTpC3MUhd8KyamHOnPvtB2HK5 amzY/49ocWMB79VVHN5NN9yK8qD+5bcWQMfEQ= MIME-Version: 1.0 In-Reply-To: <20091109144717.0cd17421.akpm@linux-foundation.org> References: <20091103094703.GB11134@hack.redhat.com> <20091103230548.0B45.A69D9226@jp.fujitsu.com> <20091104002544.0B4A.A69D9226@jp.fujitsu.com> <20091109144717.0cd17421.akpm@linux-foundation.org> From: Bryan Donlan Date: Mon, 9 Nov 2009 19:00:17 -0500 Message-ID: <3e8340490911091600v3a0e9b67r279349ac852d604a@mail.gmail.com> Subject: Re: [PATCH v5] Added PR_SET_PROCTITLE_AREA option for prctl() To: Andrew Morton Cc: KOSAKI Motohiro , Americo Wang , Timo Sirainen , Ulrich Drepper , LKML , linux-api@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 984 Lines: 20 On Mon, Nov 9, 2009 at 5:47 PM, Andrew Morton wrote: > What happens if userspace unmaps the memory after telling the kernel to > use it? > > Will processes which try to read the command line get an error reading > /proc? ?If so, do all the commandline-reading programs in the world > handle this in an appropriate fashion? This case can already occur in the current code; the userspace process would have to munmap() the top of its stack, but it certainly can do so if it tries. In any case, access_process_vm() then returns 0 because of the fault, and thus /proc/pid/cmdline is seen to have zero length. Since a zero-length /proc/pid/cmdline occurs with kernel threads as well, we know this isn't a problem. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/