From patchwork Wed Dec 14 03:35:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiubo Li X-Patchwork-Id: 2940 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp518549wrn; Tue, 13 Dec 2022 19:45:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ydk0N0Wefp3k2mJXea9Ar1XnkeNSrZJVIG8nFKu/FFlCkOPvj+BOlsSYDO5InGZmI61TB X-Received: by 2002:a17:906:6d8e:b0:7ad:b6d8:c9d0 with SMTP id h14-20020a1709066d8e00b007adb6d8c9d0mr18590613ejt.53.1670989508654; Tue, 13 Dec 2022 19:45:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670989508; cv=none; d=google.com; s=arc-20160816; b=1IOz7KJdEYbIo3VRF+HhqA9TtzDSnd9wqg8ttuZi/TVtEzSVKDmQKT1AulnQ6BOel3 kg6Jpx0Zgf72A8fhGurRHv9Iif4eUsBIj8WdTHxWb4UN5qgpJQHxaQkVg5X2+WVvDOs1 xEKjmHfHxBVDlc4LQ+Jmu1DVqOlTzhfTVcRSDxMYmwdwQEaigT8pTQzwCtpCGmXnGxlS aXNRNg41Ruww2+ByOxShLevgSadIOG0UfCRjHQhNcquqT2h7yvWKvnCznPauSBb/mdLx VqGp0XyKMFkXuXIs9AAXikgPXqWMUqS+jzyHen6FDZqfCx0efk9G4KYfM5MrI6UOch3H kJNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3oWzEWDKF7jyLo4VyiGYj9Y3gscol4rk/pAHlktmxvs=; b=wn2QGf73iH+5gDBYfr1cdlgvGiFTDIS1ui6xlvgN8AOKGqWTkZQJPm7uMssc+1y2IV eUAeuxj+YvC5QZmnGGpMuZl4OdRRi37+OWPg98NNo5Gct6LFQxrCRMhG8e+pyZzYQdSX XIoWL2uH8moY6cBl7ej6GhNURJ7JctxkyMokbXEPCexrTev4ayT6UTNfOKevHjyLoN4Q RyaCMMC34GDb40wmedqGeiEy7AICM20bPZnvY+guiU8m/SgzAT1LXmG5TtEbgDex15oM +g0cKqqpZYrTwHxul6E3fqHLTSqPj/QgccjN/9nfGXr2ip5+OHikCORO4+DMirUfsGsb Zu9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A6Z6pTkS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz13-20020a1709077d8d00b007c0a5799e70si11551519ejc.534.2022.12.13.19.44.19; Tue, 13 Dec 2022 19:45:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A6Z6pTkS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237292AbiLNDgV (ORCPT + 99 others); Tue, 13 Dec 2022 22:36:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbiLNDgS (ORCPT ); Tue, 13 Dec 2022 22:36:18 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E80F819C35 for ; Tue, 13 Dec 2022 19:35:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670988931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3oWzEWDKF7jyLo4VyiGYj9Y3gscol4rk/pAHlktmxvs=; b=A6Z6pTkSFeuxHUeEbgO2V68AsjPBnccLdjGadnp1iZaD2NSFdSeeTfGKeZOcXqHSWxzkPI 5BdUXA//Un+JpcEVBqyYPSSzxEUbDqKqtcEVB2mWOaBD5vIBaeh1gr0GkUSPVvS532vNlr c6b4J/RMUaVDpQqzyUDyvoIu+rPzjTc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-224-eMhrSi0GNWuDfL_uqp_FkA-1; Tue, 13 Dec 2022 22:35:27 -0500 X-MC-Unique: eMhrSi0GNWuDfL_uqp_FkA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1677985A588; Wed, 14 Dec 2022 03:35:19 +0000 (UTC) Received: from lxbceph1.gsslab.pek2.redhat.com (unknown [10.72.47.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 870072166B26; Wed, 14 Dec 2022 03:35:23 +0000 (UTC) From: xiubli@redhat.com To: jlayton@kernel.org, idryomov@gmail.com, ceph-devel@vger.kernel.org Cc: mchangir@redhat.com, lhenriques@suse.de, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Xiubo Li Subject: [PATCH v5 0/2] ceph: fix the use-after-free bug for file_lock Date: Wed, 14 Dec 2022 11:35:10 +0800 Message-Id: <20221214033512.659913-1-xiubli@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752159495345437205?= X-GMAIL-MSGID: =?utf-8?q?1752159495345437205?= From: Xiubo Li Changed in V5: - s/fl_inode/inode/ Changed in V4: - repeat the afs in fs.h instead of adding ceph specific header file Changed in V3: - switched to vfs_inode_has_locks() helper to fix another ceph file lock bug, thanks Jeff! - this patch series is based on Jeff's previous VFS lock patch: https://patchwork.kernel.org/project/ceph-devel/list/?series=695950 Changed in V2: - switch to file_lock.fl_u to fix the race bug - and the most code will be in the ceph layer Xiubo Li (2): ceph: switch to vfs_inode_has_locks() to fix file lock bug ceph: add ceph specific member support for file_lock fs/ceph/caps.c | 2 +- fs/ceph/locks.c | 24 ++++++++++++++++++------ fs/ceph/super.h | 1 - include/linux/fs.h | 3 +++ 4 files changed, 22 insertions(+), 8 deletions(-) Reviewed-by: Ilya Dryomov