Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E87BC43381 for ; Tue, 26 Mar 2019 07:53:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DCDD720828 for ; Tue, 26 Mar 2019 07:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731377AbfCZHxh (ORCPT ); Tue, 26 Mar 2019 03:53:37 -0400 Received: from isilmar-4.linta.de ([136.243.71.142]:37422 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731298AbfCZHxh (ORCPT ); Tue, 26 Mar 2019 03:53:37 -0400 Received: from light.dominikbrodowski.net (isilmar.linta [10.0.0.1]) by isilmar-4.linta.de (Postfix) with ESMTPS id B0EF02009A3; Tue, 26 Mar 2019 07:53:35 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id E8BA520AF9; Tue, 26 Mar 2019 08:18:19 +0100 (CET) Date: Tue, 26 Mar 2019 08:18:19 +0100 From: Dominik Brodowski To: =?iso-8859-1?Q?Aur=E9lien?= Aptel Cc: sfrench@samba.org, linux-cifs@vger.kernel.org Subject: Re: v5.1-rc1 cifs bug: underflow; use-after-free. Message-ID: <20190326071819.GA10639@light.dominikbrodowski.net> References: <20190319162645.GA3498@light.dominikbrodowski.net> <871s316bqi.fsf@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <871s316bqi.fsf@suse.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org On Wed, Mar 20, 2019 at 12:12:21PM +0100, Aurélien Aptel wrote: > Dominik Brodowski writes: > > Thanks for taking a look at this issue. Fortunately, it is easily > > reproducable (at least for me). > > Which server are you doing this against? I couldn't reproduce against > Windows Server 2016. Had to find that out first, as I'm merely a user here: It's OES 2015 with Samba version 3.6.3. > >> If you enable verbose debugging [1], if my theory is correct you should > >> see a lease break messsage followed by "clear cached root file handle" > >> message before the warning. > > > > Hm, no. > > Ok well I'm not sure what is happening then. But the final points still > stand: > > - since we don't free anything in the release function, there is no > use-after-free. > - the access to the kref is already protected by crfid.fid_mutex so we > could replace it with a regular int and avoid the warning generated by > kref_put() that you see. If you have a patch ready, I can easily test that. Thanks, Dominik