lkml.org 
[lkml]   [2018]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: fs: hfs: Possible issue with increment of extent
On Fri, Aug 31, 2018 at 02:39:11PM +0100, Colin Ian King wrote:
> Hi,
>
> Static analysis has picked up a potential issue with an out of bounds
> read in fs/hfs/extent.c; the following for-loop in hfs_free_fork()
> increments i and also extent while also reading extent[i].count. This
> looks incorrect to me, I think the increment of extent is not needed:
>
> for (i = 0; i < 3; extent++, i++)
> blocks += be16_to_cpu(extent[i].count);
>
> res = hfs_free_extents(sb, extent, blocks, blocks);
>
> I'm not familiar enough with the code to conclude that removing the
> increment of extent is necessary a correct fix just in case I'm missing
> something subtle here.

Goes back to commit d1081202f1d0 (in bk-to-git historical tree)
Author: Andrew Morton <akpm@osdl.org>
Date: Wed Feb 25 16:17:36 2004 -0800

[PATCH] HFS rewrite

From: Roman Zippel <zippel@linux-m68k.org>

and it's almost certainly a bug in there, judging by the code nearby...

\
 
 \ /
  Last update: 2018-08-31 15:57    [W:0.033 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site