All of lore.kernel.org
 help / color / mirror / Atom feed
* cifsFileInfo leak when doing cifs_atomic_open on a symlink file
@ 2022-04-24  9:53 Kinglong Mee
  0 siblings, 0 replies; only message in thread
From: Kinglong Mee @ 2022-04-24  9:53 UTC (permalink / raw)
  To: Steve French; +Cc: kinglongmee, linux-cifs

Hi steve,

Recently I've started running LTP tests with mfsymlinks mount option.

The LTP test "fs_racer" triggers the cifsFileInfo leak when doing
cifs_atomic_open on a symlink file.

After testing and umounting cifs mount, there are some files exist in
/proc/fs/cifs/open_files as,

#cat /proc/fs/cifs/open_files
# Version:1
# Format:
# <tree id> <persistent fid> <flags> <count> <pid> <uid> <filename>
0x2 0x94c08 0x8401 1 1554873 0 11
0x2 0x94b5f 0x8401 1 1554808 0 7
0x2 0x947cf 0x8401 1 1554365 0 0
0x2 0x9470a 0x8401 1 1554339 0 0

and the tcp socket also left,

# netstat -an |grep 445
tcp        0      0 192.168.123.123:38050    192.168.123.124:445 
ESTABLISHED

and the cifsd left too.

# ps -ajx |grep cifsd
       2   34030       0       0 ?             -1 S        0   2:20 [cifsd]

I found the fs_racer cause cifs doing cifs_atomic_open on symlink file,
but the symlink file does not contain a valid i_fop setting, it means,
the cifsFileInfo allocated for the symlink file never be un-referenced.

I'd wanna know, is cifs_atomic_open on symlink file allowed?
If allowed,  a cifs_close for symlink file is needed.
Otherwise, cifs_atomic_open needs return error for symlink file.

Any comments are welcome.

Thanks,
Kinglong Mee

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-24  9:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24  9:53 cifsFileInfo leak when doing cifs_atomic_open on a symlink file Kinglong Mee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.