lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210612210953.34dff323@xhacker>
Date:   Sat, 12 Jun 2021 21:09:53 +0800
From:   Jisheng Zhang <jszhang3@...l.ustc.edu.cn>
To:     Dave Young <dyoung@...hat.com>, Baoquan He <bhe@...hat.com>,
        Vivek Goyal <vgoyal@...hat.com>
Cc:     kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org
Subject: [PATCH] fs/proc/vmcore: hide mmap_vmcore_fault() and
 vmcore_mmap_ops for nommu

From: Jisheng Zhang <jszhang@...nel.org>

Without CONFIG_MMU, we get a W=1 build warning:

fs/proc/vmcore.c:443:42: warning: unused variable 'vmcore_mmap_ops' [-Wunused-const-variable]
static const struct vm_operations_struct vmcore_mmap_ops = {

The vmcore_mmap_ops is only referenced from an #ifdef'ed caller, so
this uses the same #ifdef around vmcore_mmap_ops and mmap_vmcore_fault().

Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Jisheng Zhang <jszhang@...nel.org>
---
 fs/proc/vmcore.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 9a15334da208..d902a67cc3ea 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -401,6 +401,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
 	return __read_vmcore((__force char *) buffer, buflen, fpos, 1);
 }
 
+#ifdef CONFIG_MMU
 /*
  * The vmcore fault handler uses the page cache and fills data using the
  * standard __vmcore_read() function.
@@ -443,6 +444,7 @@ static vm_fault_t mmap_vmcore_fault(struct vm_fault *vmf)
 static const struct vm_operations_struct vmcore_mmap_ops = {
 	.fault = mmap_vmcore_fault,
 };
+#endif
 
 /**
  * vmcore_alloc_buf - allocate buffer in vmalloc memory
-- 
2.32.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ