From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 04EBE37DE8A; Wed, 20 May 2026 18:28:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301706; cv=none; b=WhNUz0V3GPUvqcqpFH0zNSTIafpVkFtBAfYVOqSwmJfscqs9mm4HDNxuKYZoBfdNAH3hKLk6WMivZYdYsjA4jAMSVNrh5sPwOW+PnH7y6a5K4Ol8fpzIA0xrYF29UrkZCaZkK6P0PCnooeC5yIZsjD3UI+JOGO8euzPhMOgYQYA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301706; c=relaxed/simple; bh=51tfWaPowrlTlzuItnz2jwxMI0bEfOm4JPPRrX04NKQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G4MsFRD3hhrE3ihYPc+CQgJTaowtbWQ3xVBxCXvwaqlUZo5ro7mtm/yb+Z9SNwxwcWya6z5R5qbKakNvlFbicxvJaAZvABFFWA3N8/5UTe3mXzO2fc0yw+Gg1AK/5h1Qk3WQESMta9R+8kfyHDXYaevH9a9wc3Dz49J8duMWaKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=v8TJqX6r; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="v8TJqX6r" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C9BB1F000E9; Wed, 20 May 2026 18:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779301704; bh=fFqxO0+DqhKq262CgPb+clJFkzS05l21OLU0jfX48G8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=v8TJqX6r+SQZyRWkTyDifhthRKzsFFY55TN20sXW4JsExvbYe8cqcKSa8mQb1JoSD 7q2nJ2HzRkeBt+ac3bx1eixU32F3V8X/emYwQ0gGGpE0jeKaBGZhagI7Iop3pwhOh+ h00W5hX4TEivB238Vjs7N2qamtIj78QphhwxH698= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ricardo Robaina , Sergio Correia , Paul Moore Subject: [PATCH 6.12 614/666] audit: fix incorrect inheritable capability in CAPSET records Date: Wed, 20 May 2026 18:23:45 +0200 Message-ID: <20260520162124.579082564@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162111.222830634@linuxfoundation.org> References: <20260520162111.222830634@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sergio Correia commit e4a640475e43f406fdfd56d370b1f34b0cbbc18d upstream. __audit_log_capset() records the effective capability set into the inheritable field due to a copy-paste error. Every CAPSET audit record therefore reports cap_pi (process inheritable) with the value of cap_effective instead of cap_inheritable. This silently corrupts audit data used for compliance and forensic analysis: an attacker who modifies inheritable capabilities to prepare for a privilege-escalating exec would have the change masked in the audit trail. The bug has been present since the original introduction of CAPSET audit records in 2008. Cc: stable@vger.kernel.org Fixes: e68b75a027bb ("When the capset syscall is used it is not possible for audit to record the actual capbilities being added/removed. This patch adds a new record type which emits the target pid and the eff, inh, and perm cap sets.") Reviewed-by: Ricardo Robaina Assisted-by: Claude:claude-opus-4-6 Signed-off-by: Sergio Correia Signed-off-by: Paul Moore Signed-off-by: Greg Kroah-Hartman --- kernel/auditsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -2845,7 +2845,7 @@ void __audit_log_capset(const struct cre context->capset.pid = task_tgid_nr(current); context->capset.cap.effective = new->cap_effective; - context->capset.cap.inheritable = new->cap_effective; + context->capset.cap.inheritable = new->cap_inheritable; context->capset.cap.permitted = new->cap_permitted; context->capset.cap.ambient = new->cap_ambient; context->type = AUDIT_CAPSET;