Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3114938rdb; Tue, 6 Feb 2024 07:35:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEi2z/GvC4Vfoto1kf5aAcoTEG2idDcwi6KAb7ypWV/DXwmqJ4diHTPr5I662i7hZWA9xhP X-Received: by 2002:a17:902:7484:b0:1d8:b6c8:d9e0 with SMTP id h4-20020a170902748400b001d8b6c8d9e0mr1817337pll.68.1707233721494; Tue, 06 Feb 2024 07:35:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707233721; cv=pass; d=google.com; s=arc-20160816; b=uPZwUhnAZIFCvNfZHEc28cK1rWrnQsI9gROpmieBZpyRullb/KLqcRB//MoMQxezJu l/7h1bPQqv/4J4mooPH2AidDJ4OIRq9G/RtxN4qeHx1BdeY5TFp7xy8r3Fe2SVfXUJuK AtZ7uKs2i6Z2QmbqhVdRitK8/e+g9l7296MAVv8896Y3E8/HhWjIYMlGJ3/6WNv+Vqi0 OXdRFB9HOSkfCAdv6qTf3XgajqdiM0RMWBwVwXYBG7CO6MuJp3l0CDlC52UeF9z6r9Yc r7B4w6NiiYti5P2YR0YwXHg9XNrZSMB29dSdtuIeCtSgyudq7vPLYcaw5R8Cjhld4BjU M66A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=z6xtk+lTQ1Wv+Q+hYgJigN7nkM3Jee/QikU40oHDl6o=; fh=8X/yv9pv2BIop6aMNRzvVbSzjmF1SX90iOq9V5gKKVg=; b=YEqgvgcByayzN5vKR5XJWpVu8U80mqzMT7KpwqWJAwVBcJnvfX5BCaAaYWGpnC0c3f G+cFTJH+3St3M2rtG+Ns2Ud+pHuxivMpWABShrT3m1FMQTW9K4XgxzadUSZx7zegCbkR esuAhDrns8qlzOyxBh2QVcDIqYWddns8jGl4oyeRT8Y6W0mSGzKnqdClVB4TF9ikCvMx vpyVzDltA5KUiR4dUN8h36ewY59OufrrihwfJazLSDyZqtCPz067d3/YG4ikdJymQhwR XIm4lnZ62RgoiaWSLEQUi1VIXdthvnY1xiNDaF9AAaWsTlEr/fghA05RTB/vGfrGkslb nk6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gh2hGqik; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-55237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCUcaQ9SurFblFZzd+/7VgIHLZFxBLsfUVl3a82Kxiuw14rraYx/C0udJHZPyzWNRRZ+4fzhsTcVSD2HarAkI3JzSYZ8xfEaHtErZg331Q== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l2-20020a170902d34200b001d6ed2e9c87si1793307plk.29.2024.02.06.07.35.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 07:35:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gh2hGqik; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-55237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5FA2F29205E for ; Tue, 6 Feb 2024 15:28:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41F4D1339AB; Tue, 6 Feb 2024 15:24:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gh2hGqik" Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 BEC191384B7; Tue, 6 Feb 2024 15:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707233039; cv=none; b=NQZam8pS8YC866yanZIHkuuVwo/TZoPQIXyBA/VDfJWua7+7Nk46beA0eRwqeGMtLaUX58gPlULCKvB806vjk6lM3tg+TyglZg9BW9q3iegs9NVTkoMi/w2XRQfhFLSRZdS1EHp/wQXq4RCUd0ubH6RdT7JD5aIwXWjmFXicFiM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707233039; c=relaxed/simple; bh=h6D7G40HLhvkIPZAkoYgGRkOEa7a+WeavQnqf68/ZkA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=EMK3oQV64Apf4aqWFoUdV6wTKlirXpi2rxShuHXpeMeWwq2cYVKFiHCOZ60nFNu6B1iYbj1X6tbT/dGzVTVJQYnL92KO9kFmGHxG2vfAj1d+78lzn79JkTFQ4O+7lwU9uKI8R+qYjnPVN+qALtLHjJBPfAHTYhK5ibDACKItDNc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gh2hGqik; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-68c4300518bso26272926d6.3; Tue, 06 Feb 2024 07:23:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707233036; x=1707837836; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=z6xtk+lTQ1Wv+Q+hYgJigN7nkM3Jee/QikU40oHDl6o=; b=gh2hGqik9xsYI0PoSblqr3HtoYJbJDGPKSA1cdOiLU8R6uGgWwIAJF/xl0lPD3grUB 0inSWo2aic8xoEITO7voxNPqALYUg8U0KIo7RUJHtbx6i1N/PDkWkla7Cc9jSc+WN/ns /FK1zCwyeE0tSplopioa83ZCn6YwQIgwwtl97NGcSNSTzPcOOhbh/nWzCIAuH0sGA8Ih YyIUvV/TPsqrjNWPsBBgbhEddhHpQVZzlyxhIegNS73fXO0hlcqjQUNAAYU35upo4/tb FCUIgTPq8umxBvQ3aAjXuZ8I2lqT3hIq8s6IbOBNPyIENHB6mGOhcG1uiNKljnS1e5Gt l9vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707233036; x=1707837836; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z6xtk+lTQ1Wv+Q+hYgJigN7nkM3Jee/QikU40oHDl6o=; b=UnMoMLsdd3v0Zc98Km6ALpMacwxnm1voBdx5ImzSqdNEgXQHlwZMXjYxwfk1B3s0E6 IuUDGWK47KL58cvefBChhvNuebUG4vkueWTw4CqgT2uLDkkkxxD4Qq5e+/yzDBlnu9QI MMetUEN4vncy8qh2Mzw7rp1UTFzuY1VIrvbwOWr8E69QO8mJsYbZHghRfpncfi5cbmIg my1UUdfq3BiSnqeUWgmALlmqTGkzn0Y2SRTGsqOeRNRV9uxFqwmubyeU8ldWC1Lkf4QE QUaMPG259tVXSu/DSmgAtArZgia20OIXqEOrsuXPG6KlHShTEmtcYMBsHvNVaZqX4iNu 8pqQ== X-Gm-Message-State: AOJu0Yw8C0W/VXaT/dZwqx7T3WDy71hnmS4H0pYnfafSllkD+5+uKMqu k1GXIAtwkEv9Le8r8zNfAiiuKAlga1zCCoMtZd8aIKp8tCq3yjAQu68uit+GzYbZ2bgh0ks71nO 3M8VYGmAKNOe4AkjVtKggSiSZ99oTEQAQT4Y= X-Received: by 2002:a05:6214:1c07:b0:68c:6cc8:1bfe with SMTP id u7-20020a0562141c0700b0068c6cc81bfemr4008827qvc.38.1707233036632; Tue, 06 Feb 2024 07:23:56 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240205182506.3569743-1-stefanb@linux.ibm.com> <20240205182506.3569743-2-stefanb@linux.ibm.com> In-Reply-To: <20240205182506.3569743-2-stefanb@linux.ibm.com> From: Amir Goldstein Date: Tue, 6 Feb 2024 17:23:45 +0200 Message-ID: Subject: Re: [PATCH v2 1/9] ima: Rename backing_inode to real_inode To: Stefan Berger Cc: linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, zohar@linux.ibm.com, roberto.sassu@huawei.com, brauner@kernel.org, miklos@szeredi.hu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 5, 2024 at 8:25=E2=80=AFPM Stefan Berger wrote: > > Rename the backing_inode variable to real_inode since it gets its value > from real_inode(). > > Suggested-by: Amir Goldstein > Signed-off-by: Stefan Berger Acked-by: Amir Goldstein > --- > security/integrity/ima/ima_main.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/i= ma_main.c > index cc1217ac2c6f..f1a01d32b92a 100644 > --- a/security/integrity/ima/ima_main.c > +++ b/security/integrity/ima/ima_main.c > @@ -208,7 +208,7 @@ static int process_measurement(struct file *file, con= st struct cred *cred, > u32 secid, char *buf, loff_t size, int mas= k, > enum ima_hooks func) > { > - struct inode *backing_inode, *inode =3D file_inode(file); > + struct inode *real_inode, *inode =3D file_inode(file); > struct integrity_iint_cache *iint =3D NULL; > struct ima_template_desc *template_desc =3D NULL; > char *pathbuf =3D NULL; > @@ -285,14 +285,16 @@ static int process_measurement(struct file *file, c= onst struct cred *cred, > iint->measured_pcrs =3D 0; > } > > - /* Detect and re-evaluate changes made to the backing file. */ > - backing_inode =3D d_real_inode(file_dentry(file)); > - if (backing_inode !=3D inode && > + /* > + * Detect and re-evaluate changes made to the inode holding file = data. > + */ > + real_inode =3D d_real_inode(file_dentry(file)); > + if (real_inode !=3D inode && > (action & IMA_DO_MASK) && (iint->flags & IMA_DONE_MASK)) { > - if (!IS_I_VERSION(backing_inode) || > - backing_inode->i_sb->s_dev !=3D iint->real_dev || > - backing_inode->i_ino !=3D iint->real_ino || > - !inode_eq_iversion(backing_inode, iint->version)) { > + if (!IS_I_VERSION(real_inode) || > + real_inode->i_sb->s_dev !=3D iint->real_dev || > + real_inode->i_ino !=3D iint->real_ino || > + !inode_eq_iversion(real_inode, iint->version)) { > iint->flags &=3D ~IMA_DONE_MASK; > iint->measured_pcrs =3D 0; > } > -- > 2.43.0 >