Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 355958f2 authored by Eric W. Biederman's avatar Eric W. Biederman
Browse files

cifs: Use BUILD_BUG_ON to validate uids and gids are the same size



The assumption that sizeof(uid_t) is the same as sizeof(gid_t) is
completely reasonable but since we can verify the condition at
compile time.

Cc: Steve French <smfrench@gmail.com>
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 46bbc25f
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -297,6 +297,7 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
	 * probably a safe assumption but might be better to check based on
	 * probably a safe assumption but might be better to check based on
	 * sidtype.
	 * sidtype.
	 */
	 */
	BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t));
	if (sidkey->datalen != sizeof(uid_t)) {
	if (sidkey->datalen != sizeof(uid_t)) {
		rc = -EIO;
		rc = -EIO;
		cFYI(1, "%s: Downcall contained malformed key "
		cFYI(1, "%s: Downcall contained malformed key "