Summary: | makefs: Reject UFS labels that are too long to fit | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Fabian Keil <fk> | ||||
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
Status: | Open --- | ||||||
Severity: | Affects Some People | CC: | emaste, pstef | ||||
Priority: | --- | Keywords: | patch | ||||
Version: | CURRENT | Flags: | fk:
mfc-stable11?
|
||||
Hardware: | Any | ||||||
OS: | Any | ||||||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210463 | ||||||
Attachments: |
|
For bugs matching the following conditions: - Status == In Progress - Assignee == "bugs@FreeBSD.org" - Last Modified Year <= 2017 Do - Set Status to "Open" In 2017, Ed imported option parsing from NetBSD so this patch no longer applies. While I support the improvement, it has the side effect that since all strings are handled like this: case OPT_STRARRAY: strlcpy((void *)options[i].value, val, (size_t) options[i].maximum); break; you can't be selective about which truncation is tolerable and which is not. Ed, maybe we should reject any and all truncation errors in this path? |
Created attachment 185810 [details] makefs: Reject UFS labels that are too long to fit If a specified UFS label is too long to fit, makefs currently silently truncates it. This causes problems if the created file system contains files like /etc/fstab that expect the whole label. You may end up with a release image that was built "successfully" but doesn't actually boot. The attached patch lets makefs reject UFS labels that don't fit which makes the issue easier to spot. Obtained from: ElectroBSD