From patchwork Thu Oct 10 15:26:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= X-Patchwork-Id: 13830432 Received: from smtp-1909.mail.infomaniak.ch (smtp-1909.mail.infomaniak.ch [185.125.25.9]) (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 B203B1C9ED3 for ; Thu, 10 Oct 2024 15:34:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.25.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728574475; cv=none; b=Eatci3QjjtyyHEYACRVq4qVlquFGhgJLbK3EoXqjpGjoM5aVAalhVFn1j33vn7HPZdnvx4I2KDQze5/+2egAGxVLi/uUajtXHO47KPtUWGgXA+3sIbJ5E4G5jhCu8IMvkZR5jgtkaoOQyXp2mDpefsqMkx2WHvRvWuYneTId9fk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728574475; c=relaxed/simple; bh=Vri/r0kNCh5EU1OTk7JJRg44INfy3aDynIPyEgdheKw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oZOdmlL+788pXGaLgU+jr1jq5fX4PMaTNCrKEuh6GDwAhco5kPB5+a0EMDYF3BLdZFKSMd6mGe3oAQa0OvaXpRq9dz9B7aCn7z/ojiDLtptzDx7Cz7g68aaF4PvEqsO5nYd5jKqlaCwoUAVsp4Fh4u4gqwxWdIlAbQPAUUD3r2E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net; spf=pass smtp.mailfrom=digikod.net; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b=hWNGFBMf; arc=none smtp.client-ip=185.125.25.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digikod.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b="hWNGFBMf" Received: from smtp-4-0001.mail.infomaniak.ch (unknown [IPv6:2001:1600:7:10:40ca:feff:fe05:1]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4XPYX4594xz66K; Thu, 10 Oct 2024 17:27:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digikod.net; s=20191114; t=1728574020; bh=SdLulSzLT9TYl10U9ZqAnL7lkf3eOC+kIIq0uoFGsDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hWNGFBMfIp1QSTsWRQlrQDxzvxvOygpg0kHOobA5wJtDJY3BwxjkdEX1oRPf7WJ7z laIho5wqdxc7WL98l7jtNzi5MDL6aRLiAmClXYe8IGACDGSUoCtKP/Sd/bbRI/j7bz FJjktKckl2gMB65AcGalWicLifgoj9td+JomvmZc= Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4XPYX2758tzSKb; Thu, 10 Oct 2024 17:26:58 +0200 (CEST) From: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= To: Christian Brauner , Paul Moore Cc: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-security-module@vger.kernel.org, audit@vger.kernel.org, Mimi Zohar , Roberto Sassu , Dmitry Kasatkin , Eric Snowberg Subject: [RFC PATCH v1 4/7] integrity: Fix inode numbers in audit records Date: Thu, 10 Oct 2024 17:26:44 +0200 Message-ID: <20241010152649.849254-4-mic@digikod.net> In-Reply-To: <20241010152649.849254-1-mic@digikod.net> References: <20241010152649.849254-1-mic@digikod.net> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Infomaniak-Routing: alpha Use the new inode_get_ino() helper to log the user space's view of inode's numbers instead of the private kernel values. Cc: Mimi Zohar Cc: Roberto Sassu Cc: Dmitry Kasatkin Cc: Eric Snowberg Signed-off-by: Mickaël Salaün --- security/integrity/integrity_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/integrity/integrity_audit.c b/security/integrity/integrity_audit.c index 0ec5e4c22cb2..e344d5bcf99c 100644 --- a/security/integrity/integrity_audit.c +++ b/security/integrity/integrity_audit.c @@ -62,7 +62,7 @@ void integrity_audit_message(int audit_msgno, struct inode *inode, if (inode) { audit_log_format(ab, " dev="); audit_log_untrustedstring(ab, inode->i_sb->s_id); - audit_log_format(ab, " ino=%lu", inode->i_ino); + audit_log_format(ab, " ino=%llu", inode_get_ino(inode)); } audit_log_format(ab, " res=%d errno=%d", !result, errno); audit_log_end(ab);