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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200428213747.3663311-1-arnd@arndb.de>
Date:   Tue, 28 Apr 2020 23:37:30 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Russell King <linux@...linux.org.uk>
Cc:     Arnd Bergmann <arnd@...db.de>, Christoph Hellwig <hch@....de>,
        Russell King <rmk+kernel@...linux.org.uk>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ARM: oabi-compat: fix epoll_ctl build failure

Two functions are not declared or defined when CONFIG_EPOLL is
disabled:

arch/arm/kernel/sys_oabi-compat.c: In function 'sys_oabi_epoll_ctl':
arch/arm/kernel/sys_oabi-compat.c:258:6: error: implicit declaration of function 'ep_op_has_event' [-Werror=implicit-function-declaration]
  258 |  if (ep_op_has_event(op) &&
      |      ^~~~~~~~~~~~~~~
arch/arm/kernel/sys_oabi-compat.c:265:9: error: implicit declaration of function 'do_epoll_ctl'; did you mean 'sys_epoll_ctl'? [-Werror=implicit-function-declaration]
  265 |  return do_epoll_ctl(epfd, op, fd, &kernel, false);
      |         ^~~~~~~~~~~~
      |         sys_epoll_ctl

Blank out the entire function contents in this case.

Fixes: c281634c8652 ("ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl()")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
Alternatively, we could use stub functions in the header file, or
hide the entire function and use sys_ni_syscall() to provide a
stub entry point.
---
 arch/arm/kernel/sys_oabi-compat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
index 85a1e95341d8..cdc99bab1a1d 100644
--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
@@ -252,6 +252,7 @@ struct oabi_epoll_event {
 asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
 				   struct oabi_epoll_event __user *event)
 {
+#ifdef CONFIG_EPOLL
 	struct oabi_epoll_event user;
 	struct epoll_event kernel;
 
@@ -263,6 +264,9 @@ asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
 	kernel.data   = user.data;
 
 	return do_epoll_ctl(epfd, op, fd, &kernel, false);
+#else
+	return -ENOSYS;
+#endif
 }
 
 asmlinkage long sys_oabi_epoll_wait(int epfd,
-- 
2.26.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ