From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2475382F1A for ; Tue, 12 May 2026 19:12:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778613158; cv=none; b=eaaI15TY+hq7QYcXgtKKKXDzhoy1L63AK5FCY5Xlf7ZMnlp17HXKQS3LocK4tgQDgeN7FKPRDIwtQwbNP8uoEAc3fQZvvK+EhdJfbo4TF3nxYU0OpBYw8wtkj7NEmGIiE4TJ2PU4mho6phptFYO7H+qIeV9I+UwFilLRSDTpcJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778613158; c=relaxed/simple; bh=i9gm++O7V3BQT5CieMmipA90HVECAUmxaNsWBwBHkPI=; h=Date:Message-ID:MIME-Version:Content-Type:From:To:Cc:Subject: References:In-Reply-To; b=XaN2Szgv5YJeJDxmglgt7+B8LozRJaYBVECYWdQDJ0mPS2thbPCshGBsRW10/H7Dj5Z0HbKegUX7d+wQrXMGgPNSwDu2KDjom3KikdU10S1DavzZMpB0J4xuyQtXI0x1uYJOKu2uhpqH00KqP1SwA/xSfTY5MvzgUnUDugx9ADE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com; spf=pass smtp.mailfrom=paul-moore.com; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b=Us/vcoGW; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b="Us/vcoGW" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-8d65f4073bfso808930785a.3 for ; Tue, 12 May 2026 12:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1778613156; x=1779217956; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :mime-version:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=Z2/2RePmAVzJ7jfmnqD6PsuhJr6xU+tFwvrW/Kgm4H0=; b=Us/vcoGWN6R3kNn972qJu5wTJHFWWxO0fbH2WMU2CozEwKe/CRHFErQoZI8tlJyOFL pgGK7URZUHg2LGyzmk3F7lKmKuT+rYnyWgE8A+M37fll6uIfbGNHE2bVZg6WJXPdg3NA u1lHsUTUr+wswh13UIPJHh1r/DKcN2hrcJ2KAl+PXmh75ZxyUOYcTWvX/LJAAyE58baS EckXSeyk5oTaBNR7mXvnQmTofZT+C4lygqMn2vLsaZrI1K5lxj4Z1BEIF+WVSNuBgoOr JT4fjDfoWw/NqSX1DlEGR3ZsTZciHgitN23OU/pkqpX0SrmF6WMEUsNQjsWra3u4rDk6 X6ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778613156; x=1779217956; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :mime-version:message-id:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z2/2RePmAVzJ7jfmnqD6PsuhJr6xU+tFwvrW/Kgm4H0=; b=cKdSjDue6+jB83xwUxphc+Y+1JljRfDUr6bHVnTQKRw0fddPpnVOwFWhSagMTD7V57 udoIAVGA4H2nn01GZr36Kxhfbe25IufiG1Vfdmyttrd7RRp8a4xpsQ8vNsT7VqKuLbnP MEFFvhXJlt2j12SR8h1IciIJdVfIyyXLSX6riudoz5Z03pPQcCCncTg2BUqKvH7GjaXH DVUH3UrbN38x9auapnNqYtk8FXPncsFDJU5rLKz18H/K5kRHpRvSNHgp2aLYK2d6cl7W CxcqbzeBB5dVOaeFswOzpHm+O+3jzWKrkdIcfJ2mdHxVBTjMxXybzDgHrF3ujHLHuDwq d+kQ== X-Forwarded-Encrypted: i=1; AFNElJ8urdlFOxogB8cuJSLb/zbqc1t/ihyzK6Nnh0b6AjTFUen+wGD0A7F5AgzTyp3KFCOHrignhxfnQs42W+o=@vger.kernel.org X-Gm-Message-State: AOJu0YzxU48qu2TxuDyebmFn7TNLt0NY0JEQXoCri/lcJAsUPGxKy65q hQj8OkxAgBNSDzMDE2RSa++/SXkaclYyhNnHGyc+Vjb8uXrEAhB2EfdaHfofPDdEug== X-Gm-Gg: Acq92OEFZHgrraJAI3dSXk/CSffE7qnAeM/C6i0k6PoV2oTproLfhpVcoD/VG4eFsJi XZBgUu477dre9VqasqyG7Yw8YjyMMriIJEDyQjE2HosLBWcd6sZD2EjRfg2+DS2NgQAJqPc/fOb Ddr5rwd76kKuNCq7fl0CHqyGgM8784ghsHHyzPBjvPHsM3PiVLx9IYG0uUrfFcXkF7kWMusCZIL 1gmL14csDagLV2EJ9K753yAtmVadm9aWoyLugTGO7Bdr2Ml8JWnyVPv3FpXUgTsGjk4ZO1IYoas X8+GvEYhRB2lcgTE0AOQ1ZXnHvrAw4FO9wgO7nDOHBtBW9RPVjwaJCdjRkvNBGakqSgVPLVFND5 1ekB3eQekeE1+DxJOBPdyc8mPbN6q1N13TkYAJz4VXOsO4THu1fkMFOQuzQ1rffqYobtC8R5sBN mc0o4yjirGyxpTHHz7sEBfyviGVOBeqPrHUOm5FZK3ja2icDXkGyHwsxgAmJBicmacEawf X-Received: by 2002:a05:620a:29c1:b0:8c6:b247:4c with SMTP id af79cd13be357-90f882f7554mr45674185a.2.1778613155720; Tue, 12 May 2026 12:12:35 -0700 (PDT) Received: from localhost (pool-71-126-255-178.bstnma.fios.verizon.net. [71.126.255.178]) by smtp.gmail.com with ESMTPSA id af79cd13be357-907b986aeccsm1394843085a.4.2026.05.12.12.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2026 12:12:34 -0700 (PDT) Date: Tue, 12 May 2026 15:12:34 -0400 Message-ID: <402f11211fcab76b6410f3f57372c58f@paul-moore.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: pstg-pwork:20260511_1539/pstg-lib:20260512_1209/pstg-pwork:20260511_1539 From: Paul Moore To: Ricardo Robaina , audit@vger.kernel.org, linux-kernel@vger.kernel.org Cc: eparis@redhat.com, rgb@redhat.com, longman@redhat.com, Ricardo Robaina Subject: Re: [PATCH 2/2] audit: fix removal of dangling executable rules References: In-Reply-To: On Apr 14, 2026 Ricardo Robaina wrote: > > When an audited executable is deleted from the disk, its dentry > becomes negative. Any later attempt to delete the associated audit > rule will lead to audit_alloc_mark() encountering this negative > dentry and immediately aborting, returning -ENOENT. > > This early abort prevents the subsystem from allocating the temporary > fsnotify mark needed to construct the search key, meaning the kernel > cannot find the existing rule in its own lists to delete it. This > leaves a dangling rule in memory, resulting in the following error > while attempting to delete the rule: > > # ./audit-dupe-exe-deadlock.sh > No rules > Error deleting rule (No such file or directory) > There was an error while processing parameters > > # auditctl -l > -a always,exit -S all -F exe=/tmp/file -F path=/tmp/file -F key=dr > > # auditctl -D > Error deleting rule (No such file or directory) > There was an error while processing parameters > > This patch fixes this issue by removing the d_really_is_negative() > check. By doing so, a dummy mark can be successfully generated for > the deleted path, which allows the audit subsystem to properly match > and flush the dangling rule. > > Fixes: 76a53de6f7ff ("VFS/audit: introduce kern_path_parent() for audit") > Acked-by: Waiman Long > Signed-off-by: Ricardo Robaina > Acked-by: Richard Guy Briggs > --- > kernel/audit_fsnotify.c | 4 ---- > 1 file changed, 4 deletions(-) Good catch. I might reorder the patchset so this patch comes first in the patchset, but this isn't a big deal either way. -- paul-moore.com