linux/fs/fat
OGAWA Hirofumi 6dfc16f3e1 fat: fix memory allocation failure handling of match_strdup()
commit 35033ab988 upstream.

In parse_options(), if match_strdup() failed, parse_options() leaves
opts->iocharset in unexpected state (i.e.  still pointing the freed
string).  And this can be the cause of double free.

To fix, this initialize opts->iocharset always when freeing.

Link: http://lkml.kernel.org/r/8736wp9dzc.fsf@mail.parknet.co.jp
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Reported-by: syzbot+90b8e10515ae88228a92@syzkaller.appspotmail.com
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-11-20 18:05:45 +00:00
..
cache.c fs/fat: fix two checkpatch issues in cache.c 2012-10-06 03:05:10 +09:00
dir.c fat: fix fake_offset handling on error path 2015-12-14 10:17:11 +00:00
fat.h fs/fat/: add support for DOS 1.x formatted volumes 2014-06-06 16:08:10 -07:00
fatent.c fat: no need to reset EOF in ent_put for FAT32 2012-10-06 03:05:12 +09:00
file.c fs: Give dentry to inode_change_ok() instead of inode 2017-02-23 03:53:52 +00:00
inode.c fat: fix memory allocation failure handling of match_strdup() 2018-11-20 18:05:45 +00:00
Kconfig vfat: Note the NLS requirement 2009-04-17 09:32:11 -07:00
Makefile fat (exportfs): move NFS support code 2012-10-06 03:05:09 +09:00
misc.c fs/fat: use fat_msg() to replace printk() in __fat_fs_error() 2013-07-03 16:08:01 -07:00
namei_msdos.c Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
namei_vfat.c Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
nfs.c fat (exportfs): rebuild directory-inode if fat_dget() 2013-04-29 18:28:41 -07:00