Re: [darwin-kernel] devfs_make_node mutilates pathname on Leopard?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com under OS X 10.5, when I install a file system device with -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On Dec 12, 2007, at 8:27 AM, Steve Checkoway <s@pahtak.org> wrote: On Dec 12, 2007, at 8:17 AM, Alexander v. Below wrote: procDevice = devfs_make_node(myDevice, DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, path) where "path" is an actual path (like foo/bar/myDevice), then the device gets created in /dev/fo/ba/myDevice. This does not happen in 10.4 Is this just a plain bug, or am I doing something wrong? This has come up a number of times on the list recently. As I recall, this is both not supported and an off-by-one error introduced when switching from some standard library function to some supposedly "safe" version which was supposed to prevent these sorts of errors. See the list archive for more details. Specifically, creation of subdirectories in /dev is not officially supported, don't do that. The change of function precludes kernel buffer overflow based crashes for some device drivers using name information supplied from user space. Even with the "off by one" introduced in the changeover, the buffet overrun is avoided, which is a good thing for kernel stability. In general, device node length is constrained overall to a value "reasonable" for a single path component, which means the more /'s you used, the shorter the name allowed for the eventual device anyway. I think the overall limit is something like 32 characters; if that's not exactly correct, whatever it is is a heck of a lot smaller than PATH_MAX at 1024 bytes. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert