From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) (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 601673BFAD1 for ; Tue, 26 May 2026 23:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779836416; cv=none; b=rmSVKzi06dYDCGK5uCEK9LgaJnXbNms1lzwnbOsOX+C4cnvL7Q+CNLKvww7xq3SGdeFvMDL9S3CpWBnXlR1vBmEKo2MLz+4mapVk8gHdWxbuMoHjHoHhpKcutpeJEuONzyEdEhjmWcfwYM6noryOL9JoHijCQdNhlIY2DcgfWeE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779836416; c=relaxed/simple; bh=+uRbzz5AyCUsDbRrb/GU6Uhn7FLl3Jx5tCu0ePg5V3o=; h=Date:Message-ID:MIME-Version:Content-Type:From:To:Cc:Subject: References:In-Reply-To; b=NkT1d6IfzyUzq2n+nUGepS8HvEDzRtaQCJuz0xRAN3Cy5YzQsUNxQ51MvejqGXRZCxPshYQaeTJFTibnLiLyeaNKaYv2a5ZuCn1MYCuEoP76RnrXc/1BYNbkuYv3C3LxsoyMmzB+QmFxLuxEkYO7T2TCwE5xkIYvIrZA18nW9Ak= 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=YsKcPujs; arc=none smtp.client-ip=209.85.219.68 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="YsKcPujs" Received: by mail-qv1-f68.google.com with SMTP id 6a1803df08f44-8cc0ef7c306so84299096d6.3 for ; Tue, 26 May 2026 16:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1779836413; x=1780441213; 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=gdBVsMe5ZBVw60rKHtMu0pWGx97YtPHOG8LV2Ijiw5s=; b=YsKcPujsDUPMy/zC40CvmmPG6HYQD5IZq1kej5tJua/BD7JLIy+tZk4kQ8PZcV6WAx dSwVdaK592H3lMREU0iJe3BtnTQlrqGTTVk6plIpHTlXbVP3HY8UBb0e/um6VCIn151e RshXbkCrXZvMN+mc7f3t4w534rlGWjND0NI3/22bLzZqY7B5LAMgojZSYiDl7twwpeVX MAkywi8hz7YDaXH/pOEliWhobCo4Rgk3W+/sdi25lm4nF5HNpL8XZdO2rnxBoELycIUm /A2nHIKzWbpkQ2auWkjDDacSi+jPFsY51CScBuVCvnGb5QZhzCGQM0KkJdaoJGaR8Hcp gIvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779836413; x=1780441213; 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=gdBVsMe5ZBVw60rKHtMu0pWGx97YtPHOG8LV2Ijiw5s=; b=KDYJe+amuMs87oU5cyGZjvlVmFgn/mAnNEFRpIE4hRxVnSILr9B0MLcMDnfgzOWOjR rkz1ST+0WYa9uF+90sA9sRVMiQ9LtOXKFByJrJ9ZJTCFIDXsvq1JoLwwlLVz4NN6OqEa 0VAnZ5uT3x/8SX9IiqUM3HfPA3fl5YV60wms9TLKKUQMbXF+UbrQEKCj3nVvkxLVCND6 bDsNGAXi69Q6CIuKb9e+6JN/nfPc2O+X8RNmKJDaqCjwLQ3O6GftlEYWEh2rX4wzDfgx 8lnMXh2dE9RERjvG1O4/04TbM9VHFve/n9zReZB9aMzI0bAUBGTrsaNU7jl2NHnm0Hdy r7Mg== X-Forwarded-Encrypted: i=1; AFNElJ/D0JbFbBvaeU7ER7FD97aBOGqBRmP10vhPHfl41bs6nzg/bKJ8WzUN8mwptOhBKRektmOYCfvzKYGWaxU=@vger.kernel.org X-Gm-Message-State: AOJu0Ywze5V2VBkgXBWuEQysc01eItc7ThTPP/Q8CbETgHJrD0I+wXIq siRn9Ct2vioyxxp1cs0bYak8Kfqly1qiUKUi6SQyu4DlRh5JqD/VEYE58R/91KRtow== X-Gm-Gg: Acq92OFnd7lv5DbTM++amHyuyS+GCx7yWBIwR5sTnaYguUZFv5fTddBW0WHBZ1OjiOi ZCfg1A1a0TztL65bMF4dymuoDIgY2zaruGDwh1z9EmiVez7TkzUJzW8ScY9QyRymnxEeGA9CnVB pKpnby16LgFJlIqnmZmGdETYGhHS/R74GhY9epx24liOwV29mfmx7QkLTTeywYivSiafhf3eYuf UElS99p35KXULyG48r2iKP+968JkCX3xYsuyenuTHkzx+JEM0GAJHfL0FlS6qS6KoG4s0aQAWsk jiIBpJ2m6QgM5x/CpY/74xOCFx3x9N80Nr9ad/W+DqI6I7xSjhW1fNVXYE44DVnpihmIr3dI9Te FKfG3JkVEHbalf9dtSPHg21GhCtTa3h5x7+q1s6QUsjC+C+34VrNb6StjWnoevAMdxGvnc/jZP0 oU/FVc8zt8mngpNgh/ClspNd2X0PBqVnvvrzqAbH6aqked39uFK8FBRxkpg62/C05i/f7s X-Received: by 2002:a05:6214:300e:b0:8ca:164c:a861 with SMTP id 6a1803df08f44-8cc7b4ec38emr372431136d6.2.1779836413238; Tue, 26 May 2026 16:00:13 -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 6a1803df08f44-8cc80dcd81esm153058876d6.9.2026.05.26.16.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2026 16:00:12 -0700 (PDT) Date: Tue, 26 May 2026 19:00:11 -0400 Message-ID: <18f1ccfd1e80b91948e3445775be31a6@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:20260526_1654/pstg-lib:20260526_1539/pstg-pwork:20260526_1654 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 v2 1/2] audit: fix removal of dangling executable rules References: <7f0a259c6e6b5a1da6578fb83b531276425aa030.1778704210.git.rrobaina@redhat.com> In-Reply-To: <7f0a259c6e6b5a1da6578fb83b531276425aa030.1778704210.git.rrobaina@redhat.com> On May 13, 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 > Acked-by: Richard Guy Briggs > Signed-off-by: Ricardo Robaina > --- > Changes in v2: > - New patch order: now patch 1/2 (was 2/2 in v1) per maintainer feedback > > kernel/audit_fsnotify.c | 4 ---- > 1 file changed, 4 deletions(-) Annotated for stable, but merged into audit/dev as I want to give this a few extra weeks of soak time in linux-next. -- paul-moore.com