Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/kern



On Jun 27,  6:59pm, max%m00nbsd.net@localhost (Maxime Villard) wrote:
-- Subject: Re: CVS commit: src/sys/kern

| Yet it seems pretty obvious to me. As you explained in the comment, the
| function is supposed to return an absolute path. Here, however, it does
| not return an absolute path:
| 
| 	if (len + 1 >= MAXPATHLEN)
| 		goto out;
| 
| Nor does it initialize 'offs'. Notice, in addition, the "XXX: GCC" you put
| in the caller, as if GCC was wrong in reporting that because of the
| aforementioned branch, 'offs' wasn't getting initialized properly.
| 
| So, has this become intentional, or not? Because it seems clear it wasn't
| intentional when you initially committed it.

No, it is not intentional and it is a bug. Thanks for pointing it out.

Initially the code used to tolerate non-absolute paths (and being
able to execute binaries without resolving the full path) but
eventually having the full path became necessary (to support the
sysctl to get the executable path for example, or for $ORIGIN).
This was not enforced in exec_makepathbuf(), but it is enforced
later pathexec() which makes little sense since if you can coerce
exec_makepathbuf() to return a relative path you can potentially
crash the kernel.

Thanks for pointing it out and it would have been helpful if you
communicated the specific issue in the first place.

christos


Home | Main Index | Thread Index | Old Index