Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp385038imn; Fri, 29 Jul 2022 09:47:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4msfsFHvUtsBsT4cVr/gRi/5YCjKzwzLJuGcDf1WWZVf0+ANHXCBgc4i1JlLoemLFcRLEh X-Received: by 2002:a17:903:2683:b0:16e:c630:fb2e with SMTP id jf3-20020a170903268300b0016ec630fb2emr1267139plb.52.1659113239200; Fri, 29 Jul 2022 09:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659113239; cv=none; d=google.com; s=arc-20160816; b=MByYVYsB37DnB3kocbKeyHDU4VlVxQkNRo2DiP/xnJLdaRhLylRBlfermOAzPgc7UN CorwrtF8h5SQDdFhINYZAJHnDfPXqDVjNEljEKAz3S/CQyC69MBXnRXKEntKtggn485C lkScRKIaM4Hxex0WHuN3pJFxsCXuY5upwcAtJN1axmhkZ/VySl0Fiz/CnpmmNFVsyEdm 5W9O63fDYeKyBGU6R5YSytrKLivCbZLCSG2Bj+/fjU4XK/Jik6x53O8aF0S5jfzw7tm8 xw0GvmDKuXlvB9zbQ0RCjX2Q9yLGlNJrZ+/OGz17EVOVRpouLc12ioJKobAjUa+n7puQ likw== 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 :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=nUesyg820kD2LFrMitU8S/o3Hhtfxx5YxguzdMKG/aE=; b=VaHE3wf49LWeLOEPmX7zPqFHCqzoKHnoq2CH0ISt8LffECby3uYq4Ozo7h1HlTsE+C KwQMOPnX0qozmpbbWd4zZwnufU8O9kSyaFd5Yt9bgDrTc4+LLLet5zpz5SXnLzEEDAOx vYU/lMHX9FF22bVngVk8kYAT/4LaTuQ1xr5bB0cHBio+zlY0wrz8LvDUeGgda9BojvzL wF+Q83kCLop1FiQTDI/Amv4uZ56AuJh0RQoD5dTOoHGW3M5+fMGPegFl2CNMN0kGquhR DxONf6i5Xv3DVJ3dftUaRpT1F0pZdI2AwdAHeMtktXbu6xo2u4UgktifGHXfyJe6hCcM 6Btg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A6Erw9Lk; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a170902da8600b0016d20f6b892si5499022plx.206.2022.07.29.09.47.04; Fri, 29 Jul 2022 09:47:19 -0700 (PDT) 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=A6Erw9Lk; 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 S237340AbiG2QkM (ORCPT + 99 others); Fri, 29 Jul 2022 12:40:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237818AbiG2Qjy (ORCPT ); Fri, 29 Jul 2022 12:39:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CF58588F3D for ; Fri, 29 Jul 2022 09:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659112775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nUesyg820kD2LFrMitU8S/o3Hhtfxx5YxguzdMKG/aE=; b=A6Erw9LkNmKQFE19QDI2cBfa/U5LdUjLw3CC6Knd7LApVFErRgB2aFOF1qhUjP7yuK4lBl bAKe5CvtSbtPGjbcWZ/NHlcNnMQXZyfWQiVr+eMeLnXnxO+m1wSQ+SUcqHZjdjPaSM3CS9 4vhgOc4tzdE9aokbhSxMC9B/epcjzgY= 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-556-Dgi74NMONO67_x_iJEqXMQ-1; Fri, 29 Jul 2022 12:39:32 -0400 X-MC-Unique: Dgi74NMONO67_x_iJEqXMQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7FFBF85A584; Fri, 29 Jul 2022 16:39:32 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6330492C3B; Fri, 29 Jul 2022 16:39:31 +0000 (UTC) Subject: [PATCH 0/2] afs: Fix ref-put functions From: David Howells To: linux-afs@lists.infradead.org Cc: Marc Dionne , dhowells@redhat.com, Marc Dionne , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 29 Jul 2022 17:39:31 +0100 Message-ID: <165911277121.3745403.18238096564862303683.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Here's a pair of patches: the first converts afs to use refcount_t instead of atomic_t for its refcounts; the second fixes a number of afs ref-putting functions to make sure they don't access the target object after the decrement unless the refcount was reduced to 0. The patches can be found here: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-fixes David --- David Howells (2): afs: Use refcount_t rather than atomic_t afs: Fix access after dec in put functions fs/afs/cell.c | 61 ++++++++++++++++++-------------------- fs/afs/cmservice.c | 4 +-- fs/afs/internal.h | 16 +++++----- fs/afs/proc.c | 6 ++-- fs/afs/rxrpc.c | 31 ++++++++++--------- fs/afs/server.c | 46 +++++++++++++++++----------- fs/afs/vl_list.c | 19 ++++-------- fs/afs/volume.c | 21 ++++++++----- include/trace/events/afs.h | 36 +++++++++++----------- 9 files changed, 124 insertions(+), 116 deletions(-)