lkml.org 
[lkml]   [2019]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[BUG] fs: f2fs: Possible null-pointer dereferences in update_general_status()
Date
In update_general_status(), there are two if statements to
check whether SM_I(sbi) is NULL:
LINE 70:     if (SM_I(sbi) && SM_I(sbi)->fcc_info)
LINE 78:     if (SM_I(sbi) && SM_I(sbi)->dcc_info)

When SM_I(sbi) is NULL, it is used at some places, such as:
LINE 88: reserved_segments(sbi)
                  return SM_I(sbi)->reserved_segments;
LINE 89: overprovision_segments(sbi)
                  return SM_I(sbi)->ovp_segments;
LINE 112: MAIN_SEGS(sbi)
                    (SM_I(sbi)->main_segments)

Thus, possible null-pointer dereferences may occur.

These bugs are found by a static analysis tool STCheck written by us.

I do not know how to correctly fix these bugs, so I only report them.


Best wishes,
Jia-Ju Bai

\
 
 \ /
  Last update: 2019-07-25 11:50    [W:0.048 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site