Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4097562ybi; Fri, 19 Jul 2019 14:59:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyHdkiJfREGAcEvOfgMrxETUaqLltJPjcwGk6yCdPv+Wit263u/vutWy4oqXcg59yH5dlQ X-Received: by 2002:a17:90b:d8b:: with SMTP id bg11mr60196804pjb.30.1563573544903; Fri, 19 Jul 2019 14:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563573544; cv=none; d=google.com; s=arc-20160816; b=jUll3bJi9quv19iIJ3ZPLwpKTi6YClwBMM6JX3Je7zjxr7D1BUO0sNK2m8IhioBrRY OPy74WQJldCMcCEGwBvUKjacoQG6uoC3/GARFFPPB5PfbITX3ujmD1BTewNaRPjerk3L rYk1I7I2OKqNgn23WSW+9GFU0svFl0na7HgEabs3fzdgQOnc2Gh26sz2vbcW8J7ppQKv oZo11tvJRhf8hgKH54jomJQX9PpGTbjVpB9Eg61FSdoVBs32qUQkEBSYBBdNR18qDmed ukk8JgWFqf7T81Wc9cVhBff/7mA5orGBbt+k7gfG6/ReC2GOHQh/pvAYHGsdfleTrCt5 r9nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=y7hK4W8aYqmkwADfRUtefqEcKsina00WHWomKECa7SM=; b=ySM2qi36HkyCqUnHFBdotrvCTiLnYQmStXzjoTfR7cf+CTaaLDi1LiuGIYT8pAepEe Q+fQWVm1n1Zxnef0vg+TgaghrJ4Tys1+Xg5BDEaa+Fuztlz/P2C2jGZYExGviFtRkm4o 2IzND/LbEKdKdKm7dzFlVAzVtoH3ZdRYvhc5TOPItGdoTbLVAKFFcNx0N4FBe2C/kuGD 5vnbEJ629q+IQPQ3h87YjxMDQ9gu29v5JvD112CGYyzAj7tkDQ+xQdDTvP6uUq+VtHXo Vq0GEn7IGA/aF1bB5/8hqGjl8Dsa5BzAb3NfnBrARMJySyzrtBxj2CApcccW/aNCJz87 UjnA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59si2601838plc.425.2019.07.19.14.58.48; Fri, 19 Jul 2019 14:59:04 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728889AbfGSTcN (ORCPT + 99 others); Fri, 19 Jul 2019 15:32:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56928 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727953AbfGSTcN (ORCPT ); Fri, 19 Jul 2019 15:32:13 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1157330A7C5D; Fri, 19 Jul 2019 19:32:13 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-160.bos.redhat.com [10.18.17.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97B1F5D961; Fri, 19 Jul 2019 19:32:10 +0000 (UTC) Subject: Re: [PATCH v8 13/19] locking/rwsem: Make rwsem->owner an atomic_long_t To: Luis Henriques Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , linux-kernel@vger.kernel.org, x86@kernel.org, Davidlohr Bueso , Linus Torvalds , Tim Chen , huang ying References: <20190520205918.22251-1-longman@redhat.com> <20190520205918.22251-14-longman@redhat.com> <20190719184538.GA20324@hermes.olymp> From: Waiman Long Organization: Red Hat Message-ID: <2ed44afa-4528-a785-f188-2daf24343f97@redhat.com> Date: Fri, 19 Jul 2019 15:32:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190719184538.GA20324@hermes.olymp> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 19 Jul 2019 19:32:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/19 2:45 PM, Luis Henriques wrote: > On Mon, May 20, 2019 at 04:59:12PM -0400, Waiman Long wrote: >> The rwsem->owner contains not just the task structure pointer, it also >> holds some flags for storing the current state of the rwsem. Some of >> the flags may have to be atomically updated. To reflect the new reality, >> the owner is now changed to an atomic_long_t type. >> >> New helper functions are added to properly separate out the task >> structure pointer and the embedded flags. > I started seeing KASAN use-after-free with current master, and a bisect > showed me that this commit 94a9717b3c40 ("locking/rwsem: Make > rwsem->owner an atomic_long_t") was the problem. Does it ring any > bells? I can easily reproduce it with xfstests (generic/464). > > Cheers, > -- > Luís This patch shouldn't change the behavior of the rwsem code. The code only access data within the rw_semaphore structures. I don't know why it will cause a KASAN error. I will have to reproduce it and figure out exactly which statement is doing the invalid access. Thanks, Longman