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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231018231624.1044633-11-david.e.box@linux.intel.com>
Date:   Wed, 18 Oct 2023 16:16:17 -0700
From:   "David E. Box" <david.e.box@...ux.intel.com>
To:     linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org,
        dave.hansen@...ux.intel.com, arnd@...db.de, peterz@...radead.org,
        aleksander.lobakin@...el.com, ilpo.jarvinen@...ux.intel.com,
        rajvi.jingar@...ux.intel.com
Subject: [PATCH V4 10/17] linux/io.h: iounmap/ioport_unmap cleanup.h support

Add auto-release cleanups for ioumap and ioport_unmap.

Suggested-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Signed-off-by: David E. Box <david.e.box@...ux.intel.com>
---
V4 - New patch

 include/linux/io.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/io.h b/include/linux/io.h
index 7304f2a69960..1488832c4ad2 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -6,6 +6,7 @@
 #ifndef _LINUX_IO_H
 #define _LINUX_IO_H
 
+#include <linux/cleanup.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/bug.h>
@@ -20,6 +21,9 @@ __visible void __iowrite32_copy(void __iomem *to, const void *from, size_t count
 void __ioread32_copy(void *to, const void __iomem *from, size_t count);
 void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
 
+DEFINE_FREE(iounmap, void __iomem *, iounmap(_T));
+DEFINE_FREE(ioport_unmap, void __iomem *, ioport_unmap(_T));
+
 #ifdef CONFIG_MMU
 int ioremap_page_range(unsigned long addr, unsigned long end,
 		       phys_addr_t phys_addr, pgprot_t prot);
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ