Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp446468lqh; Tue, 7 May 2024 04:20:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiS1W7u94OCjHYQVEkp7aqWlLT6nl0uwLTR+aXEgoShxoRYdzx3PnaBu/LIS5OKNKQlYvq1P/S3anCRSaZ38AaH/3XS7blvPdoqdJfGQ== X-Google-Smtp-Source: AGHT+IFzuvijDS06tGKsDp+3IClDEtnb4XDajjs42XxbSWTuoguI8rUNspYb7Irq6cYsT4Km/ygc X-Received: by 2002:a50:a693:0:b0:56e:2cb6:480e with SMTP id e19-20020a50a693000000b0056e2cb6480emr10968348edc.38.1715080829763; Tue, 07 May 2024 04:20:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715080829; cv=pass; d=google.com; s=arc-20160816; b=RwBmKtpY2Ko0689FLIbEVt25xpj+Inqe0RZLrPFxzk0cYYLBROwwlisCBk7IE2A147 YOlb5ZHw9pP+jTgU3mK4Qg+qG1l9z3/KF9B6gK+PaBLErYbELDxL+zDvJi6hOyOpCaUa t5h5hrxS72PxkByY9lNn6axfN7wgT4IWJFcOEj2UeUhuhn0jmZDsxIqxgPgG5DWLfL2+ CCvBMkfIzOOcClPwUI/SXtXeJihlPNLgkJ+fnCs3hSjMx05K/9gu/nnpXpM7qdyywp27 aRWPHKjTm5yhre70bNnnj4wtQGiCPrJmz/a9sWTmLnBw9xa1dH+xJzJO85cvFIGh5SmR 1glQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=qIetLlTQh1/fweFILoQVJnd38OCcgIlnO4uh1j6AROg=; fh=Wh4j6rXLk/tyLpb5AtH3VVujV8RBE9OmEheLnVV4iu4=; b=EKiduXA8rKCsW1gs4ovg3cyPcwrgriEGZ4T23jIEHmdc4OM2CfN2W9xj1sIKT2rkot WlgE9qE2WzA9uASIb0jKujn3WBrVh8IWPFb5y4V6eTZQxmIFnWwFUQJr0cocLsYNvskc RhNe+kVPRZmcfKpo+NCIhjo3mbSJIw21CAO2fORM8ycWvwB0rRoAMnKOD6WKaqj5j6CK Md6TUABZa4nDao4UiY5OkNGoII9DqyUSlXjnre4Rim0CuWRYG45G4a0nM+dU5tgeVTAo XqsI5+/pjr7andO121YbmgtTHRZ+Si1gQ+kAUWWuu4ZwQiY+WmTA2jo9QrALpRh804wp QfPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-171186-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171186-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id be8-20020a0564021a2800b00572a9bcb44dsi5870569edb.671.2024.05.07.04.20.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 04:20:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171186-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-171186-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171186-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 787F91F25CC2 for ; Tue, 7 May 2024 11:20:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E61C152500; Tue, 7 May 2024 11:20:20 +0000 (UTC) Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 448261509A6; Tue, 7 May 2024 11:20:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715080819; cv=none; b=L6d5Y6EUazdjkr/CObEF4Or3t/vxhH4t6c4/EQ8JDtoP8+mncI28Kxbii6Pe3XIrjCGC6bPQSgubXWgE9l/QrXULTJuNQtckMYs5E3ZiSFewU2KXc9gy0W+A5nXTrvf9GBOIZoUgSbukTsJolHLWQUnOw9CA3eBbc9mOtB0nbrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715080819; c=relaxed/simple; bh=XJb5env3w+A8FoPLlKR4k/O4kmKTVVipdBC1VV39X5I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NkSpr3pyeVa3gSJ5jvCkF3LXTdFkHC5fbHcJZIyR2Sde66P81rmbLb93yiC8Jah4Zgx9/HdMr4IkWLrL20J+W5ge6LaKLVdT5UxhPlCAln+1OzRJn1n7ytTaa2zApb0TP2kDflReE62eDTSje8g+nKdCv8YHBpE5cLN2oraXTtg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VYbRC1qdrz4f3kpS; Tue, 7 May 2024 19:20:07 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 86B5A1A0572; Tue, 7 May 2024 19:20:12 +0800 (CST) Received: from [10.174.177.174] (unknown [10.174.177.174]) by APP1 (Coremail) with SMTP id cCh0CgBnOBFoDjpmOyUEMA--.18524S3; Tue, 07 May 2024 19:20:12 +0800 (CST) Message-ID: Date: Tue, 7 May 2024 19:20:08 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH 0/5] cachefiles: some bugfixes for withdraw and xattr Content-Language: en-US To: netfs@lists.linux.dev, dhowells@redhat.com, jlayton@kernel.org Cc: linux-cachefs@redhat.com, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, yangerkun , libaokun@huaweicloud.com References: <20240424032732.2711487-1-libaokun@huaweicloud.com> From: Baokun Li In-Reply-To: <20240424032732.2711487-1-libaokun@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgBnOBFoDjpmOyUEMA--.18524S3 X-Coremail-Antispam: 1UD129KBjvJXoW7tFy5Kr17Wr4fKryUWw4kWFg_yoW8Ww4DpF Wayr4ayry8W397Gwn3ArsxJr1rA393JF1vgw17Wr1DAwn5Xr1YqryIyr15ZFyUuryUGws3 t3WjgFy3Ww1UA3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkC14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWUuVWrJwAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j 6r4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCYjI0SjxkI62AI1cAE67vI Y487MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI 0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y 0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8 JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUoOJ5UU UUU X-CM-SenderInfo: 5olet0hnxqqx5xdzvxpfor3voofrz/ Hi David, Hi Jeff, Could you please take time to take a look at this series?  I'd appreciated it if I could get some feedback and comments. Thanks, Baokun On 2024/4/24 11:27, libaokun@huaweicloud.com wrote: > From: Baokun Li > > Hello everyone! > > Recently we found some bugs while doing tests on cachefiles ondemand mode, > and this patchset is a fix for some of those issues. The following is a > brief overview of the patches, see the patches for more details. > > Patch 1-2: Add fscache_try_get_volume() helper function to avoid > fscache_volume use-after-free on cache withdrawal. > > Patch 3: Fix cachefiles_lookup_cookie() and cachefiles_withdraw_cache() > concurrency causing cachefiles_volume use-after-free. > > Patch 4-5: Propagate error codes returned by vfs_getxattr() to avoid > endless loops. > > Comments and questions are, as always, welcome. > > Thanks, > Baokun > > Baokun Li (5): > netfs, fscache: export fscache_put_volume() and add > fscache_try_get_volume() > cachefiles: fix slab-use-after-free in fscache_withdraw_volume() > cachefiles: fix slab-use-after-free in cachefiles_withdraw_cookie() > cachefiles: correct the return value of > cachefiles_check_volume_xattr() > cachefiles: correct the return value of cachefiles_check_auxdata() > > fs/cachefiles/cache.c | 45 +++++++++++++++++++++++++++++++++- > fs/cachefiles/volume.c | 1 - > fs/cachefiles/xattr.c | 5 +++- > fs/netfs/fscache_volume.c | 14 +++++++++++ > fs/netfs/internal.h | 2 -- > include/linux/fscache-cache.h | 6 +++++ > include/trace/events/fscache.h | 4 +++ > 7 files changed, 72 insertions(+), 5 deletions(-) >