All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH v2] cifs: Fix leak when handling lease break for cached root fid
Date: Tue, 30 Jun 2020 18:04:16 +0800	[thread overview]
Message-ID: <202006301809.U4pU2tek%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 5274 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200630023003.1858066-1-paul@darkrain42.org>
References: <20200630023003.1858066-1-paul@darkrain42.org>
TO: Paul Aurich <paul@darkrain42.org>

Hi Paul,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on cifs/for-next]
[also build test WARNING on v5.8-rc3 next-20200629]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Paul-Aurich/cifs-Fix-leak-when-handling-lease-break-for-cached-root-fid/20200630-103420
base:   git://git.samba.org/sfrench/cifs-2.6.git for-next
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: i386-randconfig-c003-20200630 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


coccinelle warnings: (new ones prefixed by >>)

>> fs/cifs/smb2misc.c:618:5-11: preceding lock on line 605

# https://github.com/0day-ci/linux/commit/7a32ab08f9e865fa52cfb802786e6fd39df45ea3
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 7a32ab08f9e865fa52cfb802786e6fd39df45ea3
vim +618 fs/cifs/smb2misc.c

933d4b36576c95 Pavel Shilovsky 2013-09-05  592  
933d4b36576c95 Pavel Shilovsky 2013-09-05  593  static bool
933d4b36576c95 Pavel Shilovsky 2013-09-05  594  smb2_is_valid_lease_break(char *buffer)
933d4b36576c95 Pavel Shilovsky 2013-09-05  595  {
933d4b36576c95 Pavel Shilovsky 2013-09-05  596  	struct smb2_lease_break *rsp = (struct smb2_lease_break *)buffer;
933d4b36576c95 Pavel Shilovsky 2013-09-05  597  	struct list_head *tmp, *tmp1, *tmp2;
933d4b36576c95 Pavel Shilovsky 2013-09-05  598  	struct TCP_Server_Info *server;
933d4b36576c95 Pavel Shilovsky 2013-09-05  599  	struct cifs_ses *ses;
933d4b36576c95 Pavel Shilovsky 2013-09-05  600  	struct cifs_tcon *tcon;
933d4b36576c95 Pavel Shilovsky 2013-09-05  601  
933d4b36576c95 Pavel Shilovsky 2013-09-05  602  	cifs_dbg(FYI, "Checking for lease break\n");
933d4b36576c95 Pavel Shilovsky 2013-09-05  603  
933d4b36576c95 Pavel Shilovsky 2013-09-05  604  	/* look up tcon based on tid & uid */
933d4b36576c95 Pavel Shilovsky 2013-09-05 @605  	spin_lock(&cifs_tcp_ses_lock);
933d4b36576c95 Pavel Shilovsky 2013-09-05  606  	list_for_each(tmp, &cifs_tcp_ses_list) {
933d4b36576c95 Pavel Shilovsky 2013-09-05  607  		server = list_entry(tmp, struct TCP_Server_Info, tcp_ses_list);
933d4b36576c95 Pavel Shilovsky 2013-09-05  608  
933d4b36576c95 Pavel Shilovsky 2013-09-05  609  		list_for_each(tmp1, &server->smb_ses_list) {
933d4b36576c95 Pavel Shilovsky 2013-09-05  610  			ses = list_entry(tmp1, struct cifs_ses, smb_ses_list);
933d4b36576c95 Pavel Shilovsky 2013-09-05  611  
933d4b36576c95 Pavel Shilovsky 2013-09-05  612  			list_for_each(tmp2, &ses->tcon_list) {
933d4b36576c95 Pavel Shilovsky 2013-09-05  613  				tcon = list_entry(tmp2, struct cifs_tcon,
933d4b36576c95 Pavel Shilovsky 2013-09-05  614  						  tcon_list);
933d4b36576c95 Pavel Shilovsky 2013-09-05  615  				cifs_stats_inc(
933d4b36576c95 Pavel Shilovsky 2013-09-05  616  				    &tcon->stats.cifs_stats.num_oplock_brks);
7a32ab08f9e865 Paul Aurich     2020-06-29  617  				if (smb2_tcon_has_lease(tcon, rsp)) {
233839b1df65a2 Pavel Shilovsky 2012-09-19 @618  					return true;
233839b1df65a2 Pavel Shilovsky 2012-09-19  619  				}
a93864d93977b9 Ronnie Sahlberg 2018-06-14  620  
a93864d93977b9 Ronnie Sahlberg 2018-06-14  621  				if (tcon->crfid.is_valid &&
a93864d93977b9 Ronnie Sahlberg 2018-06-14  622  				    !memcmp(rsp->LeaseKey,
a93864d93977b9 Ronnie Sahlberg 2018-06-14  623  					    tcon->crfid.fid->lease_key,
a93864d93977b9 Ronnie Sahlberg 2018-06-14  624  					    SMB2_LEASE_KEY_SIZE)) {
a93864d93977b9 Ronnie Sahlberg 2018-06-14  625  					INIT_WORK(&tcon->crfid.lease_break,
a93864d93977b9 Ronnie Sahlberg 2018-06-14  626  						  smb2_cached_lease_break);
a93864d93977b9 Ronnie Sahlberg 2018-06-14  627  					queue_work(cifsiod_wq,
a93864d93977b9 Ronnie Sahlberg 2018-06-14  628  						   &tcon->crfid.lease_break);
a93864d93977b9 Ronnie Sahlberg 2018-06-14  629  					spin_unlock(&cifs_tcp_ses_lock);
d6ac9c584a6902 Paul Aurich     2020-06-26  630  					kfree(lw);
a93864d93977b9 Ronnie Sahlberg 2018-06-14  631  					return true;
a93864d93977b9 Ronnie Sahlberg 2018-06-14  632  				}
0822f51426b51b Pavel Shilovsky 2012-09-19  633  			}
0822f51426b51b Pavel Shilovsky 2012-09-19  634  		}
933d4b36576c95 Pavel Shilovsky 2013-09-05  635  	}
0822f51426b51b Pavel Shilovsky 2012-09-19  636  	spin_unlock(&cifs_tcp_ses_lock);
f96637be081141 Joe Perches     2013-05-04  637  	cifs_dbg(FYI, "Can not process lease break - no lease matched\n");
0822f51426b51b Pavel Shilovsky 2012-09-19  638  	return false;
0822f51426b51b Pavel Shilovsky 2012-09-19  639  }
0822f51426b51b Pavel Shilovsky 2012-09-19  640  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34026 bytes --]

             reply	other threads:[~2020-06-30 10:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 10:04 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-06-30  7:34 [PATCH v2] cifs: Fix leak when handling lease break for cached root fid kernel test robot
2020-06-30  2:30 Paul Aurich
2020-07-01 13:13 ` Aurélien Aptel
2020-07-02  0:53 ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202006301809.U4pU2tek%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.