From owner-freebsd-arch Wed Dec 13 5:52:57 2000 From owner-freebsd-arch@FreeBSD.ORG Wed Dec 13 05:52:55 2000 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 931F237B400; Wed, 13 Dec 2000 05:52:54 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.0/8.11.0) with ESMTP id eBDDqms79686; Wed, 13 Dec 2000 06:52:53 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id GAA38352; Wed, 13 Dec 2000 06:52:48 -0700 (MST) Message-Id: <200012131352.GAA38352@harmony.village.org> To: Terry Lambert Subject: Re: Safe string formatting in the kernel Cc: des@ofug.org (Dag-Erling Smorgrav), assar@FreeBSD.ORG, dillon@earth.backplane.com (Matt Dillon), kris@citusc.usc.edu, arch@FreeBSD.ORG In-reply-to: Your message of "Wed, 13 Dec 2000 08:42:53 GMT." <200012130842.BAA26666@usr08.primenet.com> References: <200012130842.BAA26666@usr08.primenet.com> Date: Wed, 13 Dec 2000 06:52:48 -0700 From: Warner Losh Sender: imp@harmony.village.org Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200012130842.BAA26666@usr08.primenet.com> Terry Lambert writes: : > Just be careful that your dynamic string growing things don't violate : > the hard limit invariants in the kernel. If it produces paths longer : > than 1023 characters, for example, it is wrong. : : Actually, this is rather broken already in the symlink following : code in the lookup code, since it expands links in place with : the rest of the path components, instead of properly traversing : them. So the limit there is less than 1023 for some intermediate : component of a path being a (large) symlink. Yes, but.... The longest path that you can give the kernel or get from the kernel is 1023. If the path happens to expand longer due to symlinks, or concatination with pwd, that's OK. I don't think that the kernel constructs a full path like this internally as a string, however. The point is that there are some things that other things expect to be a fixed length and if you go around violating that you are in for trouble. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message