Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932464AbWAFBbh (ORCPT ); Thu, 5 Jan 2006 20:31:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932411AbWAFBbh (ORCPT ); Thu, 5 Jan 2006 20:31:37 -0500 Received: from smtp.osdl.org ([65.172.181.4]:3477 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S932455AbWAFBbg (ORCPT ); Thu, 5 Jan 2006 20:31:36 -0500 Date: Thu, 5 Jan 2006 17:30:38 -0800 (PST) From: Linus Torvalds To: Chris Wright cc: linux-kernel@vger.kernel.org, stable@kernel.org, git-commits-head@vger.kernel.org, Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , akpm@osdl.org, alan@lxorguk.ukuu.org.uk, Greg Kroah-Hartman Subject: Re: [PATCH 4/6] sysctl: dont overflow the user-supplied buffer with 0 In-Reply-To: <20060106004555.GD25207@sorel.sous-sol.org> Message-ID: References: <20060105235845.967478000@sorel.sous-sol.org> <20060106004555.GD25207@sorel.sous-sol.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 672 Lines: 20 On Thu, 5 Jan 2006, Chris Wright wrote: > > If the string was too long to fit in the user-supplied buffer, > the sysctl layer would zero-terminate it by writing past the > end of the buffer. Don't do that. Don't use this one. It doesn't zero-pad the string if the result buffer is too small (which _could_ cause problems) and it actually returns the wrong length too. There's a better one in the final 2.6.15. Linus - 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/