Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762713AbYF0UDT (ORCPT ); Fri, 27 Jun 2008 16:03:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758135AbYF0UDL (ORCPT ); Fri, 27 Jun 2008 16:03:11 -0400 Received: from saraswathi.solana.com ([198.99.130.12]:43131 "EHLO saraswathi.solana.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753753AbYF0UDK (ORCPT ); Fri, 27 Jun 2008 16:03:10 -0400 Date: Fri, 27 Jun 2008 16:00:50 -0400 From: Jeff Dike To: Joris van Rantwijk Cc: linux-kernel@vger.kernel.org, Pekka Enberg , Thorsten Knabe , Roland McGrath Subject: Re: BUG: Linux 2.6.25 ptrace leaks struct_task Message-ID: <20080627200050.GA10859@c2.user-mode-linux.org> References: <20080627183045.GA18801@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080627183045.GA18801@xs4all.nl> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 885 Lines: 23 On Fri, Jun 27, 2008 at 08:30:45PM +0200, Joris van Rantwijk wrote: > I think sys32_ptrace() is leaking struct_task. > > In arch/x86/kernel/ptrace.c, function sys32_ptrace(), there > is a call to ptrace_get_task_struct(). In some cases (such as > PTRACE_GETREGS), there is no matching call to put_task_struct(). Yup, good diagnosis. The culprit is 5a4646a4efed8c835f76c3b88f3155f6ab5b8d9b. Doing an s/return /ret = / inside that switch should fix the bug. It looks like it's since been fixed in mainline by the restructuring done in 562b80bafffaf42a6d916b0a2ee3d684220a1c10. Jeff -- Work email - jdike at linux dot intel dot com -- 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/