Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp364971ybh; Wed, 18 Mar 2020 01:11:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsFG+5eL3KvNAGWotn/bf4D2pquDmURu2z5ca4T3WAb5jWEIyq+7gqBbQDonrzCyE/tlkrC X-Received: by 2002:aca:b803:: with SMTP id i3mr2172415oif.92.1584519115294; Wed, 18 Mar 2020 01:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584519115; cv=none; d=google.com; s=arc-20160816; b=sCid0t6mN7LeiwYdWESHqVD5dnhXP0pE2VR0JxZNndxIzmD3OH7mmCiBA8wAGVchZK FyCOyhzEL8SaJyjHgWS7RyBohq0rmEnr/YceK6zzqNoY1bBL8CVPCw0UHklGBRZQVYy3 5Tc+sb3t+eZBKkNmOW0K9g3PwQzn9vohXSmwfKfQGX9NlZu/TgbnMhkV3cniko8Sghps DkZ2H2940imu8F7JsBZ1QG5iTdeZhh3ZksdyZoqrMIJZ4mlcv0olD1gNCkwvMEcghe1Y EJdsgKnQCFUqkK1ipMf7n0DHPMyOu7mqSlXzCf87zoXTqWunx7bYABdF+X6owWG9ej/9 3yhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YXUayrHOPCJzF/6FJoY+BFEj3UMjmlbmnbZlPdkq6Po=; b=aMoBgdykSQOKQvvh7H6i635yjLf7sWPgAV0D1y5pQBbFQlgl6eJI/axr2hW3vELvSY IPTGeuwdMVyWNxJqthOjrsGKUB+PaRlsVh2SkH2eTCTHoFiPSSOCF3QLWoQUuUS3Ya7l vvW+GirAQZ6aVS0zy+9sEOJzfW3MnkkJkjidzj04y47MqtMsDmgmT8bYNDvKyDSrO8im HRwK5MSkKxmK0qB7K1IvOr4nPGW/QBm61ObnErkYRoLJbLbVtMbWnO0Vnu0ktluruuJo f8TrBoLoS7y9GGIctHlauX6fGCSozJDXnmCkn3czYJ4zbYMYcXFFOIWbU1lqfzPjwBSU aCcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="pgzbRt/r"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12si3060999otn.101.2020.03.18.01.11.42; Wed, 18 Mar 2020 01:11:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="pgzbRt/r"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727168AbgCRIKH (ORCPT + 99 others); Wed, 18 Mar 2020 04:10:07 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:36109 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725298AbgCRIKG (ORCPT ); Wed, 18 Mar 2020 04:10:06 -0400 Received: by mail-io1-f66.google.com with SMTP id d15so23986735iog.3 for ; Wed, 18 Mar 2020 01:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YXUayrHOPCJzF/6FJoY+BFEj3UMjmlbmnbZlPdkq6Po=; b=pgzbRt/reLTxd85HZ30lCVjELDNH9uycFJL3DJEFaKEB4p9NYustgyiOUAru6uWokT KI/F9LITN3XPzA7Hix1Bo5Kq1oH8I9u7saEJqACjSa8VP+P7nkpINUwi7jxAWD6K4CNJ vQOkhkvXrfBiMHt9EyVawr+UOjGLjnJ/9yMeKb6MDNXLm8i19ya5cJU+qY9xF99Omoas qBq1oi26LxtSVWRiI7FOXmaUq7KF+D/ioNFopm5Bs5ePKqM6mVJ1W9iVIrnwN5ojUTuU w3zqG/TXVPYrLW2zsd2Rg85DQ0lKTp1K09boKVZDyP6OAd882v6yqAvxx9/1dX90r1tf ijVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YXUayrHOPCJzF/6FJoY+BFEj3UMjmlbmnbZlPdkq6Po=; b=Bf4Ke42yy4r+jsbWQkpvumwHATGql8Ry31nfyti2HPbGgGYkC2CqOVXC13YCJ9cC6o QsRY449uXOBl9EvBJUNHjS0Iyxa0d8xMXkhS9r6Qb0v6a6uTri6xjW343mvK8foRztaK Jct1Gjv13IPPzj8uWXsW8kfV5TzevoWEv6cdI2bdKocLqKiiP515tvbeOgch0xWUHO+T +2ofdyHnOUZbwABfvRc1rRmLFEiAZPsDUU5d+XDbmiRJsgTByEyHkipC+vWf0BmON78z MOwGDKTCscSSM3QTsWW1RVxecf1h7EJmLghjnt0IiRGxYX3uXmvrRQWUDkP01xrdfBn8 kbsQ== X-Gm-Message-State: ANhLgQ01obCDYnpYQT04mk9Q8zLf0X4RuSNHziBNne7j59d5YTXlsMZ+ U3WHekO9PkAJedBLWAudVeztPtg4JjHRsLL2Tos= X-Received: by 2002:a6b:c813:: with SMTP id y19mr2610596iof.125.1584519005895; Wed, 18 Mar 2020 01:10:05 -0700 (PDT) MIME-Version: 1.0 References: <1584343103-13896-1-git-send-email-hqjagain@gmail.com> <20200317170243.GR2363188@phenom.ffwll.local> In-Reply-To: From: Qiujun Huang Date: Wed, 18 Mar 2020 16:09:55 +0800 Message-ID: Subject: Re: [PATCH RESEND] drm/lease: fix potential race in fill_object_idr To: Daniel Vetter Cc: Marco Elver , Maarten Lankhorst , Maxime Ripard , Dave Airlie , dri-devel , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2020 at 3:34 PM Daniel Vetter wrote: > > On Tue, Mar 17, 2020 at 11:33 PM Qiujun Huang wrote: > > > > On Wed, Mar 18, 2020 at 1:02 AM Daniel Vetter wrote: > > > > > > On Mon, Mar 16, 2020 at 03:18:23PM +0800, Qiujun Huang wrote: > > > > We should hold idr_mutex for idr_alloc. > > > > > > > > Signed-off-by: Qiujun Huang > > > > > > I've not seen the first version of this anywhere in my inbox, not sure > > > where that got lost. > > > > > > Anyway, this seems like a false positive - I'm assuming this was caught > > > with KCSAN. The commit message really should mention that. > > > > > > fill_object_idr creates the idr, which yes is only access later on under > > > the idr_mutex. But here it's not yet visible to any other thread, and > > > hence lockless access is safe and correct. > > > > Agree that. > > Do you know what the recommended annotation for kcsan false positives > like this should be? Adding kcsan author Marco. Actually it's not reported by kcsan. I found idr_alloc isn't safe for parallel modifications, and I didn't understand it's a exclusive path here. :) > -Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch