Re: [PATCH v15 1/4] Add flags option to get xattr method paired to __vfs_getxattr
Mark Salyzyn via Jfs-discussion <[email protected]> Tue, 5 Nov 2019 07:37:04 -0800
| Newsgroups | gmane.comp.file-systems.jfs.general |
|---|---|
| Message-ID | <1de43656-e751-53a2-c0da-ff44ecbabbc4__5313.50813559897$1572969971$gmane$org@android.com> |
On 11/5/19 1:48 AM, Jan Kara wrote: >> @@ -228,11 +228,11 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, >> break; >> case 1: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> break; >> case 2: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> break; >> case 3: > These scnprintf() changes (and there are more in the patch) probably > shouldn't be here... Otherwise the patch still looks good to me :). > > Honza > Good catch, they were done in locality, I forgot about them, this patch series has been living for almost a year now and time has become its enemy ... will spin this as a separate patch. They strike as a security issue with the possibility of fragile UAF when the code is maintained by future selves. -- Mark