RE: Re: [PATCH] Smack: Fix memory leak in smack_inode_getsecctx

From: CHANDAN VN
Date: Tue Jun 05 2018 - 03:05:00 EST


Â

>OnÂMon,ÂJunÂ04,Â2018ÂatÂ02:01:34PMÂ-0700,ÂCaseyÂSchauflerÂwrote:
>>ÂOnÂ6/1/2018Â10:45ÂAM,ÂCaseyÂSchauflerÂwrote:
>>Â>ÂFixÂmemoryÂleakÂinÂsmack_inode_getsecctx
>>Â>
>>Â>ÂTheÂimplementationÂofÂsmack_inode_getsecctx()Âmade
>>Â>ÂincorrectÂassumptionsÂaboutÂhowÂSmackÂpresentsÂaÂsecurity
>>Â>Âcontext.ÂSmackÂdoesÂnotÂneedÂtoÂallocateÂmemoryÂtoÂsupport
>>Â>ÂsecurityÂcontexts,ÂsoÂ"releasing"ÂaÂSmackÂcontextÂisÂaÂno-op.
>>Â>ÂTheÂcodeÂmadeÂanÂunnecessaryÂcopyÂandÂreturnedÂthatÂasÂa
>>Â>Âcontext,ÂwhichÂwasÂneverÂfreed.ÂTheÂrevisedÂimplementation
>>Â>ÂreturnsÂtheÂcontextÂcorrectly.
>>Â>
>>Â>ÂSigned-off-by:ÂCaseyÂSchauflerÂ<casey@xxxxxxxxxxxxxxxx>
>
>>ÂTejun,ÂdoesÂthisÂpassÂyourÂtests?
Â
>Oh,ÂI'mÂnotÂtheÂoneÂwhoÂreported.ÂÂChandan?
Looks good to me. Leak not found.