From patchwork Fri Nov 18 02:06:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiubo Li X-Patchwork-Id: 1872 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp734926wrr; Thu, 17 Nov 2022 18:14:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf60Ul8NXyC0DBehMvO77s+QEyiuWqW8C7eRDgaD2GiBlrwIH4bdMbD/c4LPEyQDcqoAA9eG X-Received: by 2002:a05:6402:150:b0:468:fdc3:6b44 with SMTP id s16-20020a056402015000b00468fdc36b44mr2228755edu.388.1668737692852; Thu, 17 Nov 2022 18:14:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668737692; cv=none; d=google.com; s=arc-20160816; b=y/aeYjqqPQNl6KHRbOlZKlvNSzqqgvlIipAuRKGOWFNQ93NNN7ZtC75knn/QsvCSst 4RZ/Bg7boAIOR8cJ25OA5ihnG8EIjH7WCDJtax/lVN2YMMM89GxvgcCfpP1pWml6q89Q QzpyWsYaZyvKmj63wmd14YWKVs/MZNNLJXQXgaFIrbFiwxD30lnoJ+9aRusQIFY8FN5V TtXar/iTN3UWqTIanOPNBkIK6yVQmzAgcNwCtpf1947PLO9Fiw8ldVqfU/ysZwR3gY8+ iscJsTSBuiZ/JksimPXMJXjCx51gKYT5kRROQBLOWRMnOlGx8CoF6byZxUxUefi3aZNl N19Q== 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=aQfRGAJT8YybJ6Rqyzsdpd1icwaPrtbOkq+tkn5Lzuk=; b=nEACycUM8PxCHs2pJhixZKZbPgdu7yC3QNUJCfBWqXnLh2xgUwdI3heHan0wQP/TXF tLAHqx2QvYaoFYgPdzwiajQIoTAp3my3lJx968IyI6eBEwvnWtV7Wb/1ep5hBN7MJHvx xjY48K88/zWTuTZGamvqtIC2c+51nJgaZUk0n3luMeh7f2y/HOUDXZ+FB1OOljo8I/Yb qI59a60T8ZXjG6E8TGLyjG8+EzjcFN0eFEJIce4EPS6VYlVc78ev8qMRpMjoeIrgF8Qc Jp7HZXoVUXp1Y6esdC8xx/1fYe2NNt7XerVyiqqC541HKAV90pigl2aw8r4BcnO3xa+D 8icw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Iuqj0tki; 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 xe14-20020a170907318e00b007ae417013desi1951483ejb.324.2022.11.17.18.14.29; Thu, 17 Nov 2022 18:14:52 -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=Iuqj0tki; 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 S240787AbiKRCHs (ORCPT + 99 others); Thu, 17 Nov 2022 21:07:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235139AbiKRCHr (ORCPT ); Thu, 17 Nov 2022 21:07:47 -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 4C13785EF3 for ; Thu, 17 Nov 2022 18:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668737213; 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=aQfRGAJT8YybJ6Rqyzsdpd1icwaPrtbOkq+tkn5Lzuk=; b=Iuqj0tkihwgAFK3krt75piVidNVwjkgoB9ZdBcdB32zNPb40iz+lhXDeEYG/7ZVXAvWqq7 3D4S8YhThEpcwLhKHt9bi24SAd2F8VH0dYZIM+iP+magH6C9BPchk5XlV6S0plGwsBZLq3 NoKclxwFcM3IgjtsjQUQTcU5thZEaog= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-20-hQGwFr__MCa6qtadNgj0Dg-1; Thu, 17 Nov 2022 21:06:49 -0500 X-MC-Unique: hQGwFr__MCa6qtadNgj0Dg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 02C803804A4E; Fri, 18 Nov 2022 02:06:49 +0000 (UTC) Received: from lxbceph1.gsslab.pek2.redhat.com (unknown [10.72.47.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69242C158CF; Fri, 18 Nov 2022 02:06:45 +0000 (UTC) From: xiubli@redhat.com To: ceph-devel@vger.kernel.org, jlayton@kernel.org, idryomov@gmail.com Cc: lhenriques@suse.de, mchangir@redhat.com, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Xiubo Li Subject: [PATCH 0/2 v3] ceph: fix the use-after-free bug for file_lock Date: Fri, 18 Nov 2022 10:06:40 +0800 Message-Id: <20221118020642.472484-1-xiubli@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=unavailable 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?1749798295187004017?= X-GMAIL-MSGID: =?utf-8?q?1749798295187004017?= From: Xiubo Li 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_lock_info support for file_lock fs/ceph/caps.c | 2 +- fs/ceph/locks.c | 24 ++++++++++++++++++------ fs/ceph/super.h | 1 - include/linux/ceph/ceph_fs_fl.h | 17 +++++++++++++++++ include/linux/fs.h | 2 ++ 5 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 include/linux/ceph/ceph_fs_fl.h