Skip to content

Commit a2bcdb8

Browse files
author
Baoquan He
committed
ima: rename variable the seq_file "file" to "ima_kexec_file"
JIRA: https://issues.redhat.com/browse/RHEL-114162 Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit cb50522 Author: Steven Chen <chenste@linux.microsoft.com> Date: Mon Apr 21 15:25:07 2025 -0700 ima: rename variable the seq_file "file" to "ima_kexec_file" Before making the function local seq_file "file" variable file static global, rename it to "ima_kexec_file". Signed-off-by: Steven Chen <chenste@linux.microsoft.com> Acked-by: Baoquan He <bhe@redhat.com> Tested-by: Stefan Berger <stefanb@linux.ibm.com> # ppc64/kvm Signed-off-by: Mimi Zohar <zohar@linux.ibm.com> Signed-off-by: Baoquan He <bhe@redhat.com>
1 parent 2e3ebf9 commit a2bcdb8

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

security/integrity/ima/ima_kexec.c

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,30 @@
1818
static int ima_dump_measurement_list(unsigned long *buffer_size, void **buffer,
1919
unsigned long segment_size)
2020
{
21+
struct seq_file ima_kexec_file;
2122
struct ima_queue_entry *qe;
22-
struct seq_file file;
2323
struct ima_kexec_hdr khdr;
2424
int ret = 0;
2525

2626
/* segment size can't change between kexec load and execute */
27-
file.buf = vmalloc(segment_size);
28-
if (!file.buf) {
27+
ima_kexec_file.buf = vmalloc(segment_size);
28+
if (!ima_kexec_file.buf) {
2929
ret = -ENOMEM;
3030
goto out;
3131
}
3232

33-
file.file = NULL;
34-
file.size = segment_size;
35-
file.read_pos = 0;
36-
file.count = sizeof(khdr); /* reserved space */
33+
ima_kexec_file.file = NULL;
34+
ima_kexec_file.size = segment_size;
35+
ima_kexec_file.read_pos = 0;
36+
ima_kexec_file.count = sizeof(khdr); /* reserved space */
3737

3838
memset(&khdr, 0, sizeof(khdr));
3939
khdr.version = 1;
4040
/* This is an append-only list, no need to hold the RCU read lock */
4141
list_for_each_entry_rcu(qe, &ima_measurements, later, true) {
42-
if (file.count < file.size) {
42+
if (ima_kexec_file.count < ima_kexec_file.size) {
4343
khdr.count++;
44-
ima_measurements_show(&file, qe);
44+
ima_measurements_show(&ima_kexec_file, qe);
4545
} else {
4646
ret = -EINVAL;
4747
break;
@@ -55,23 +55,24 @@ static int ima_dump_measurement_list(unsigned long *buffer_size, void **buffer,
5555
* fill in reserved space with some buffer details
5656
* (eg. version, buffer size, number of measurements)
5757
*/
58-
khdr.buffer_size = file.count;
58+
khdr.buffer_size = ima_kexec_file.count;
5959
if (ima_canonical_fmt) {
6060
khdr.version = cpu_to_le16(khdr.version);
6161
khdr.count = cpu_to_le64(khdr.count);
6262
khdr.buffer_size = cpu_to_le64(khdr.buffer_size);
6363
}
64-
memcpy(file.buf, &khdr, sizeof(khdr));
64+
memcpy(ima_kexec_file.buf, &khdr, sizeof(khdr));
6565

6666
print_hex_dump_debug("ima dump: ", DUMP_PREFIX_NONE, 16, 1,
67-
file.buf, file.count < 100 ? file.count : 100,
67+
ima_kexec_file.buf, ima_kexec_file.count < 100 ?
68+
ima_kexec_file.count : 100,
6869
true);
6970

70-
*buffer_size = file.count;
71-
*buffer = file.buf;
71+
*buffer_size = ima_kexec_file.count;
72+
*buffer = ima_kexec_file.buf;
7273
out:
7374
if (ret == -EINVAL)
74-
vfree(file.buf);
75+
vfree(ima_kexec_file.buf);
7576
return ret;
7677
}
7778

0 commit comments

Comments
 (0)