]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: potential memory leaks when parsing mnt opts
authorTaesoo Kim <tsgatesv@gmail.com>
Sat, 21 Mar 2015 23:08:30 +0000 (19:08 -0400)
committerSteve French <smfrench@gmail.com>
Sat, 21 Mar 2015 17:01:50 +0000 (12:01 -0500)
commit4528bec5726f4d76039a09a6a330f67939962cb0
treefbc079983364b9d761b111f52d7a581cf7fc5b48
parentd0b94b787d6fa3f761cb05fb2ff0d5635de2654a
cifs: potential memory leaks when parsing mnt opts

For example, when mount opt is redundently specified
(e.g., "user=A,user=B,user=C"), kernel kept allocating new key/val
with kstrdup() and overwrite previous ptr (to be freed).

Althouhg mount.cifs in userspace performs a bit of sanitization
(e.g., forcing one user option), current implementation is not
robust. Other options such as iocharset and domainanme are similarly
vulnerable.

Signed-off-by: Taesoo Kim <tsgatesv@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/connect.c