summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorChangwei Ge <ge.changwei@h3c.com>2018-11-02 15:48:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-11-03 10:09:37 -0700
commitcf76c78595ca87548ca5e45c862ac9e0949c4687 (patch)
tree76c0ddd9b37fd5f3546d5963af21d428138f4771 /mm
parent29aa30167a0a2e6045a0d6d2e89d8168132333d5 (diff)
downloadlinux-cf76c78595ca87548ca5e45c862ac9e0949c4687.tar.bz2
ocfs2: don't put and assigning null to bh allocated outside
ocfs2_read_blocks() and ocfs2_read_blocks_sync() are both used to read several blocks from disk. Currently, the input argument *bhs* can be NULL or NOT. It depends on the caller's behavior. If the function fails in reading blocks from disk, the corresponding bh will be assigned to NULL and put. Obviously, above process for non-NULL input bh is not appropriate. Because the caller doesn't even know its bhs are put and re-assigned. If buffer head is managed by caller, ocfs2_read_blocks and ocfs2_read_blocks_sync() should not evaluate it to NULL. It will cause caller accessing illegal memory, thus crash. Link: http://lkml.kernel.org/r/HK2PR06MB045285E0F4FBB561F9F2F9B3D5680@HK2PR06MB0452.apcprd06.prod.outlook.com Signed-off-by: Changwei Ge <ge.changwei@h3c.com> Reviewed-by: Guozhonghua <guozhonghua@h3c.com> Cc: Mark Fasheh <mark@fasheh.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Joseph Qi <jiangqi903@gmail.com> Cc: Changwei Ge <ge.changwei@h3c.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions