From patchwork Thu Jun 22 09:37:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 1798316 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=URYaU//2; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QmwJv3lylz20Xk for ; Thu, 22 Jun 2023 19:37:50 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qCGl4-0000jB-K7; Thu, 22 Jun 2023 09:37:42 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qCGl3-0000j4-N0 for kernel-team@lists.ubuntu.com; Thu, 22 Jun 2023 09:37:41 +0000 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 6C41A42417 for ; Thu, 22 Jun 2023 09:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1687426661; bh=LIXGb/xDpmZDHDNy6yZDguAnTNZmc3qIq1jP2XOs1bo=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=URYaU//2Lin5pbpJiG9tJ8Jj3Bf5ZEimosxrmwK25g7aHxU7Pt+GeFNL4KLSEoLCi 3pdk91g9y2hNX78A5C9qFaTYtLK5QeHzvBsSdvdYnC7sxj5XXsKTy1rkqrqGLHNEBf GFX0g0z1Vos0i7wxcl//fLRxAt/PaRpW2IrsufHV5B9Y2HvAY+EURZEhvEVA7nGxUy 0W+3sANPWwl5v4hUxwmtUiGscjoE020ZzB7YOe5H3VtJQydnFV55nA2n7ZPGX6Wh/V M7eTYCufQFFH8KGv5T1X0j4bEgji5CuBXwx0VLI6xkQC+45AomlFuWn22LZcqfGu25 ggDzb7SbXPCCQ== Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-98933d4d4c1so199541766b.0 for ; Thu, 22 Jun 2023 02:37:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687426660; x=1690018660; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LIXGb/xDpmZDHDNy6yZDguAnTNZmc3qIq1jP2XOs1bo=; b=XIzR6d97CjR4DN15uoNTTFPDJXqCsQxsHQPuCR3AEVKARtv8gy1Lyg01hj21/fx2qm cwwKAoNyVME9fB00sWxtt9nANYztRNMfsc8aiQj6yLVgWBI2h51i7U4gIp5f6GJKnK5m UWt0eJXsbwkISHd22ZoNYcGeO/rx9LTIhxdQ/Zeca00O5TH5SZtxGIYCrzeaREmQrpV4 NxcHtaZuKUOH8ArIa7ngxNMbDjN7O4vDQp/StzpNam1KZAcINtEI5A7p8Rkx42iEEtyn wefsgAm35x69Teh9dsDnDT/hveWZwqEnfnn5fa6zUBfdhvd83CWRT8KYKyjZPH0iMgRt XE0w== X-Gm-Message-State: AC+VfDztQF0PO63aLfBxolI8Om9Ug6uPcjiY8n8zSwS4Fv7lkyHJyYsq esCFeog6kB6unGUbldZs9KD4kNl4B0YxOcrLQoZBms8HjNcJj8WajFIt9Vu9BLXCimvyekxp0qM iVlG3AhBPv7+vvIwYouzczFaHiUWqpqPlAtc+smClUIh5F4umkg== X-Received: by 2002:a17:907:31ca:b0:982:487c:7508 with SMTP id xf10-20020a17090731ca00b00982487c7508mr15285944ejb.38.1687426660649; Thu, 22 Jun 2023 02:37:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Ry9LLQCa2xHAFxxWPQvGMLY75OFIzXmSF5HNs+nJhwWAmjsTzrJsSQYuE5aeJi1yII/ZuGA== X-Received: by 2002:a17:907:31ca:b0:982:487c:7508 with SMTP id xf10-20020a17090731ca00b00982487c7508mr15285933ejb.38.1687426660337; Thu, 22 Jun 2023 02:37:40 -0700 (PDT) Received: from localhost.localdomain (host-82-51-67-121.retail.telecomitalia.it. [82.51.67.121]) by smtp.gmail.com with ESMTPSA id y9-20020a17090668c900b009891f667b7bsm4210131ejr.214.2023.06.22.02.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 02:37:40 -0700 (PDT) From: Andrea Righi To: kernel-team@lists.ubuntu.com Subject: [SRU][L/K/J/F][PATCH 0/1] UBUNTU: SAUCE: overlayfs: fix reference count mismatch Date: Thu, 22 Jun 2023 11:37:29 +0200 Message-Id: <20230622093731.632666-1-andrea.righi@canonical.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2016398 [Impact] Opened files reported in /proc/pid/map_files can be shows with the wrong mount point using overlayfs with filesystem namspaces. This incorrect behavior is fixed: UBUNTU: SAUCE: overlayfs: fix incorrect mnt_id of files opened from map_files However, the fix introduced a new regression, the reference to the original file stored in vma->vm_prfile is not properly released when vma->vm_prfile is replaced with a new file. This can cause a reference counter unbalance, leading errors such as "target is busy" when trying to unmount overlayfs, even if the filesystem has not active reference. [Test case] Reproducer provided by original bug reporter: https://launchpadlibrarian.net/663151659/overlayfsscript_example [Fix] Fix by properly releasing the original file stored in vm_prfile. [Regression potential] This fix seems to solve the reported bug (verified with the reproducer) and it doesn't seem to introduce other regressions or behavior change. However, we may experience regressions in overlayfs or potentially other "target is busy" errors when unmounting overlayfs filesystems with this fix applied, if there are still other corner cases not covered properly. Acked-by: Roxana Nicolescu