Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4756079pxb; Thu, 14 Oct 2021 11:18:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxumqKSLWQTuh2+SM+d4nkgGwKdN5EJHQRd/0wOWEfO1c/12W7x/ZVncbabNXpx3A9iFzjk X-Received: by 2002:a17:906:e99:: with SMTP id p25mr660229ejf.534.1634235526588; Thu, 14 Oct 2021 11:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634235526; cv=none; d=google.com; s=arc-20160816; b=y+x7HpGnTP0NhBQEShnEUQIcbICexmPePwyaqYmSYDsB/DgDH14T+mMdiM9w9vThCN DbDksJnZ/M5B71IlT5mEu9MCmzzL0K5iRtHykfgikif3Md1A5HMY9u3buGq3poC8GYXK 7FIfznaIt6JQtArv5lRvGvqXu4RlwIc41BTKKM0VOhQKe5/h9841qny3d+mukwScVxOj t45AfcAuaVEoZ8wuK7u+wZqDig1Xwef+HokdYEXIDSlgBJQ6rrO3koELW2W+8KhkM55b sJecXoHWNV/yvvpHErBfR5621pvAHqWxBYFTp0A2S8O1L/go/PHWuPYF8hrsz8sM4YeD ufHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=w45cBwWuxt9fV0sH92Mj0nap7150VQi8dWHb0aDrKOs=; b=YYq9TxRepeU1+b9Rgb05Bmm0OgHJgotQTStP3iQtkTBgQVK7La+P2wwx8Sn8o47P/1 vnAlorSmuYZvjdY2+MykW7G7M0uOV3TPTFjlpuoHNFYaVoP25gSJu4vgW392TbHbfiwH Mn8W6lACyxySvYhG/1jlm+6nFIoyL9xIaoraDXMLgrefPj1Wu7GkNba6FHnRIGHJVbkq TQW4Iv/5msadwZqVZo4ZI5m38f0Ku9Qg5SZQiaQbvxwF+vcLYFbpndADkDDzlCBYmGDw AbsVbYC+V88ybpDfajMoZmD/a0A/gzb4ElG5KEnL0K02QsHgerzAM7bPZNVrJswTQ9lt 4u0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxtx.org header.s=google header.b=YRiavibC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h21si4641642eje.344.2021.10.14.11.18.23; Thu, 14 Oct 2021 11:18:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxtx.org header.s=google header.b=YRiavibC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232021AbhJNPPO (ORCPT + 99 others); Thu, 14 Oct 2021 11:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232901AbhJNPPJ (ORCPT ); Thu, 14 Oct 2021 11:15:09 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCDFAC061570 for ; Thu, 14 Oct 2021 08:13:04 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id i20so24905389edj.10 for ; Thu, 14 Oct 2021 08:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxtx.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w45cBwWuxt9fV0sH92Mj0nap7150VQi8dWHb0aDrKOs=; b=YRiavibCQ5dBpR8sEKXV0lV/aSByGm8aH6pXObxa96UKqW2Xp1TgT8UGf5o3j2jT/t jXFZUixi63N0FP3Ws+XLyyvnKGZpUghoP0ahHvAw6VC7pjQcj1jJyHHYr5ise4ey/pRz Z5M9nrJ+4T1D4CggdaoFf9LfYJzN+ShVVq6ug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w45cBwWuxt9fV0sH92Mj0nap7150VQi8dWHb0aDrKOs=; b=TNCTLqgIQakJxk2VE1b2acg0VUhyY74yTJM+c9L2vCxOFa01jfP8cHd/+NGLfv8fxg 8T4/VXHXAGaUXtN7zUzk841BjYaQ0NRkcI5LQmS2j1VhPwhMHrKeWA7Rp/ztkLWXQDzJ 63UbDsf8Aiv5zcgHrzNgWvHESjhSAly+hyjtMxHyrTLoS5CniXzlfr6Uyk9GuK5wtvYz dCMrUNehpN1t8fPoKEAKlDxohFpNK6tAFl2KOBJgmsV0KPryNfc8K8Ld+k4DCicuAfeG V6bOvnK16HgNI8CUZAEeavHzOb6HIrGCvR4AcMVtUEHseDALTUb3/2dW+QqyuzhVCtpF Dm2g== X-Gm-Message-State: AOAM532S1zNICJW351ZfosoC+xxxTziKDitwF4OkgNAzuwvJeyAelS/O tZGNwim9S8SjloUP5ET68hKwRgH0xpH6Pfwxj7Ircg== X-Received: by 2002:a05:6402:35d1:: with SMTP id z17mr9678857edc.174.1634224293743; Thu, 14 Oct 2021 08:11:33 -0700 (PDT) MIME-Version: 1.0 References: <163238121836.315941.18066358755443618960.stgit@mickey.themaw.net> In-Reply-To: <163238121836.315941.18066358755443618960.stgit@mickey.themaw.net> From: Justin Forbes Date: Thu, 14 Oct 2021 10:11:22 -0500 Message-ID: Subject: Re: [PATCH] autofs: fix wait name hash calculation in autofs_wait() To: Ian Kent Cc: Al Viro , autofs mailing list , Kernel Mailing List , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 23, 2021 at 2:20 AM Ian Kent wrote: > > There's a mistake in commit 2be7828c9fefc ("get rid of autofs_getpath()") > that affects kernels from v5.13.0, basically missed because of me not > fully testing the change for Al. > > The problem is that the hash calculation for the wait name qstr hasn't > been updated to account for the change to use dentry_path_raw(). This > prevents the correct matching an existing wait resulting in multiple > notifications being sent to the daemon for the same mount which must > not occur. > > The problem wasn't discovered earlier because it only occurs when > multiple processes trigger a request for the same mount concurrently > so it only shows up in more aggressive testing. I suppose it shows up in more than just testing, as we have a bug where this is impacting a user doing regular desktop things. Justin > Fixes: 2be7828c9fefc ("get rid of autofs_getpath()") > Cc: stable@vger.kernel.org > Signed-off-by: Ian Kent > --- > fs/autofs/waitq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c > index 16b5fca0626e..54c1f8b8b075 100644 > --- a/fs/autofs/waitq.c > +++ b/fs/autofs/waitq.c > @@ -358,7 +358,7 @@ int autofs_wait(struct autofs_sb_info *sbi, > qstr.len = strlen(p); > offset = p - name; > } > - qstr.hash = full_name_hash(dentry, name, qstr.len); > + qstr.hash = full_name_hash(dentry, qstr.name, qstr.len); > > if (mutex_lock_interruptible(&sbi->wq_mutex)) { > kfree(name); > >