From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756470AbdGCOdt (ORCPT ); Mon, 3 Jul 2017 10:33:49 -0400 Received: from us-smtp-delivery-194.mimecast.com ([216.205.24.194]:33618 "EHLO us-smtp-delivery-194.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754344AbdGCOdp (ORCPT ); Mon, 3 Jul 2017 10:33:45 -0400 From: Trond Myklebust To: "linux-kernel@vger.kernel.org" , "gregkh@linuxfoundation.org" CC: "kinglongmee@gmail.com" , "Anna.Schumaker@Netapp.com" , Trond Myklebust , "stable@vger.kernel.org" Subject: Re: [PATCH 3.18 14/36] NFSv4: fix a reference leak caused WARNING messages Thread-Topic: [PATCH 3.18 14/36] NFSv4: fix a reference leak caused WARNING messages Thread-Index: AQHS9AEqpchh+Fcp/ES6jgficzS8iKJCKqcA Date: Mon, 3 Jul 2017 14:33:29 +0000 Message-ID: <1499092406.79205.1.camel@primarydata.com> References: <20170703133256.260692013@linuxfoundation.org> <20170703133256.886693680@linuxfoundation.org> In-Reply-To: <20170703133256.886693680@linuxfoundation.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [50.108.4.17] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR11MB0076;20:mLNbRJIw2ZwgWNmeAgx20TC1M/l5REYkcr1uju+KL6nPWEWPAo6H7G2p+Iqg88G6306PjyOinQlKB9aPTir1HqTabraxLdJlE/759AvE7CEdt3E04MzO1+LcGgZ9MqcI8Z+hDTPZpRDNopsj6rs7V9UadG3jhqbtWheSrrN4WnM= x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10019020)(6009001)(39410400002)(39400400002)(39830400002)(39450400003)(377424004)(24454002)(14454004)(99286003)(6436002)(54906002)(77096006)(6486002)(575784001)(86362001)(6506006)(45080400002)(102836003)(3846002)(6116002)(7736002)(305945005)(2950100002)(5660300001)(36756003)(2906002)(3280700002)(229853002)(3660700001)(478600001)(8936002)(81166006)(8676002)(33646002)(50986999)(76176999)(54356999)(39060400002)(38730400002)(6246003)(2501003)(4326008)(25786009)(189998001)(66066001)(2900100001)(53936002)(103116003)(6512007);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR11MB0076;H:DM5PR11MB0075.namprd11.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; x-ms-office365-filtering-correlation-id: 9c1e2efb-ab5e-4c22-0850-08d4c2207966 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR11MB0076; x-ms-traffictypediagnostic: DM5PR11MB0076: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(236129657087228)(148574349560750); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123558100)(2016111802025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123562025)(6072148)(6043046)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR11MB0076;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR11MB0076; x-forefront-prvs: 035748864E spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <5BE168676DBE1C47AF5BDA6CC05B5000@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: primarydata.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2017 14:33:29.5679 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 03193ed6-8726-4bb3-a832-18ab0d28adb7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB0076 X-MC-Unique: wnCx2TU8PRemIwx_zfJUWw-1 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v63EXrH3017278 Hi Greg, On Mon, 2017-07-03 at 15:34 +0200, Greg Kroah-Hartman wrote: > 3.18-stable review patch.  If anyone has any objections, please let > me know. I cannot find commit a974deee477af89411e0f80456bfb344ac433c98 in v3.18.59, so I think we should probably drop this patch instance. Thanks for applying it to the newer stable kernels! Cheers Trond > > ------------------ > > From: Kinglong Mee > > commit 366a1569bff3fe14abfdf9285e31e05e091745f5 upstream. > > Because nfs4_opendata_access() has close the state when access is > denied, > so the state isn't leak. > Rather than revert the commit a974deee47, I'd like clean the strange > state close. > > [ 1615.094218] ------------[ cut here ]------------ > [ 1615.094607] WARNING: CPU: 0 PID: 23702 at lib/list_debug.c:31 > __list_add_valid+0x8e/0xa0 > [ 1615.094913] list_add double add: new=ffff9d7901d9f608, > prev=ffff9d7901d9f608, next=ffff9d7901ee8dd0. > [ 1615.095458] Modules linked in: nfsv4(E) nfs(E) nfsd(E) tun bridge > stp llc fuse ip_set nfnetlink vmw_vsock_vmci_transport vsock f2fs > snd_seq_midi snd_seq_midi_event fscrypto coretemp ppdev > crct10dif_pclmul crc32_pclmul ghash_clmulni_intel intel_rapl_perf > vmw_balloon snd_ens1371 joydev gameport snd_ac97_codec ac97_bus > snd_seq snd_pcm snd_rawmidi snd_timer snd_seq_device snd soundcore > nfit parport_pc parport acpi_cpufreq tpm_tis tpm_tis_core tpm > i2c_piix4 vmw_vmci shpchp auth_rpcgss nfs_acl lockd(E) grace > sunrpc(E) xfs libcrc32c vmwgfx drm_kms_helper ttm drm crc32c_intel > mptspi e1000 serio_raw scsi_transport_spi mptscsih mptbase > ata_generic pata_acpi fjes [last unloaded: nfs] > [ 1615.097663] CPU: 0 PID: 23702 Comm: fstest Tainted: > G        W   E   4.11.0-rc1+ #517 > [ 1615.098015] Hardware name: VMware, Inc. VMware Virtual > Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015 > [ 1615.098807] Call Trace: > [ 1615.099183]  dump_stack+0x63/0x86 > [ 1615.099578]  __warn+0xcb/0xf0 > [ 1615.099967]  warn_slowpath_fmt+0x5f/0x80 > [ 1615.100370]  __list_add_valid+0x8e/0xa0 > [ 1615.100760]  nfs4_put_state_owner+0x75/0xc0 [nfsv4] > [ 1615.101136]  __nfs4_close+0x109/0x140 [nfsv4] > [ 1615.101524]  nfs4_close_state+0x15/0x20 [nfsv4] > [ 1615.101949]  nfs4_close_context+0x21/0x30 [nfsv4] > [ 1615.102691]  __put_nfs_open_context+0xb8/0x110 [nfs] > [ 1615.103155]  put_nfs_open_context+0x10/0x20 [nfs] > [ 1615.103586]  nfs4_file_open+0x13b/0x260 [nfsv4] > [ 1615.103978]  do_dentry_open+0x20a/0x2f0 > [ 1615.104369]  ? nfs4_copy_file_range+0x30/0x30 [nfsv4] > [ 1615.104739]  vfs_open+0x4c/0x70 > [ 1615.105106]  ? may_open+0x5a/0x100 > [ 1615.105469]  path_openat+0x623/0x1420 > [ 1615.105823]  do_filp_open+0x91/0x100 > [ 1615.106174]  ? __alloc_fd+0x3f/0x170 > [ 1615.106568]  do_sys_open+0x130/0x220 > [ 1615.106920]  ? __put_cred+0x3d/0x50 > [ 1615.107256]  SyS_open+0x1e/0x20 > [ 1615.107588]  entry_SYSCALL_64_fastpath+0x1a/0xa9 > [ 1615.107922] RIP: 0033:0x7fab599069b0 > [ 1615.108247] RSP: 002b:00007ffcf0600d78 EFLAGS: 00000246 ORIG_RAX: > 0000000000000002 > [ 1615.108575] RAX: ffffffffffffffda RBX: 00007fab59bcfae0 RCX: > 00007fab599069b0 > [ 1615.108896] RDX: 0000000000000200 RSI: 0000000000000200 RDI: > 00007ffcf060255e > [ 1615.109211] RBP: 0000000000040010 R08: 0000000000000000 R09: > 0000000000000016 > [ 1615.109515] R10: 00000000000006a1 R11: 0000000000000246 R12: > 0000000000041000 > [ 1615.109806] R13: 0000000000040010 R14: 0000000000001000 R15: > 0000000000002710 > [ 1615.110152] ---[ end trace 96ed63b1306bf2f3 ]--- > > Fixes: a974deee47 ("NFSv4: Fix memory and state leak in...") > Signed-off-by: Kinglong Mee > Signed-off-by: Anna Schumaker > Cc: Trond Myklebust > Signed-off-by: Greg Kroah-Hartman > > --- >  fs/nfs/nfs4proc.c |    2 -- >  1 file changed, 2 deletions(-) > > --- a/fs/nfs/nfs4proc.c > +++ b/fs/nfs/nfs4proc.c > @@ -1995,8 +1995,6 @@ static int nfs4_opendata_access(struct r >   if ((mask & ~cache.mask & (MAY_READ | MAY_EXEC)) == 0) >   return 0; >   > - /* even though OPEN succeeded, access is denied. Close the > file */ > - nfs4_close_state(state, fmode); >   return -EACCES; >  } >   > > -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.myklebust@primarydata.com