Date: Wed, 13 Aug 2014 16:47:29 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 192640] New: [PATCH] nfsclient: Fix struct padding assumption in DIRHDSIZ Message-ID: <bug-192640-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192640 Bug ID: 192640 Summary: [PATCH] nfsclient: Fix struct padding assumption in DIRHDSIZ Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: Needs Triage Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: conrad.meyer@isilon.com Created attachment 145758 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=145758&action=edit (applies with -p0 in CURRENT svn tree) Both the old and new nfsclient code's DIRHDSIZ macro make the assumption that 'struct dirent' has no padding following d_name. (That the macro is defined seperately in 3 different .c files is a separate issue.) As a result, if the dirent structure is changed to add 64-bit members (one of a few ABI changes in OneFS), padding is added at the end of the struct and DIRHDSIZ becomes invalid (4 bytes too big). This patch changes the definition of DIRHDSIZ to use __offsetof(struct dirent, d_name) instead, which will always be correct. It fixes the DIRHDSIZ definition in the old nfsclient as well as new; if the old one will be killed shortly, there's no need to take that change. -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-192640-8>