[uml-devel] [PATCH] um: Remove hppfs

2015-04-22 Thread Richard Weinberger
hppfs (honeypot procfs) was an attempt to use UML as honeypot.
It was never stable nor in heavy use.

As Al Viro and Christoph Hellwig pointed some major issues out
it is better to let it die.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/um/Kconfig.um |  15 --
 fs/Makefile|   1 -
 fs/hppfs/Makefile  |   6 -
 fs/hppfs/hppfs.c   | 766 -
 4 files changed, 788 deletions(-)
 delete mode 100644 fs/hppfs/Makefile
 delete mode 100644 fs/hppfs/hppfs.c

diff --git a/arch/um/Kconfig.um b/arch/um/Kconfig.um
index 6e67847..bd5459c 100644
--- a/arch/um/Kconfig.um
+++ b/arch/um/Kconfig.um
@@ -44,21 +44,6 @@ config HOSTFS
   If you'd like to be able to work with files stored on the host,
   say Y or M here; otherwise say N.
 
-config HPPFS
-   tristate HoneyPot ProcFS
-   depends on PROC_FS
-   help
- hppfs (HoneyPot ProcFS) is a filesystem which allows UML /proc
- entries to be overridden, removed, or fabricated from the host.
- Its purpose is to allow a UML to appear to be a physical machine
- by removing or changing anything in /proc which gives away the
- identity of a UML.
-
- See http://user-mode-linux.sf.net/old/hppfs.html for more 
information.
-
- You only need this if you are setting up a UML honeypot.  Otherwise,
- it is safe to say 'N' here.
-
 config MCONSOLE
bool Management console
default y
diff --git a/fs/Makefile b/fs/Makefile
index cb92fd4..cb20e4b 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -115,7 +115,6 @@ obj-$(CONFIG_AFS_FS)+= afs/
 obj-$(CONFIG_NILFS2_FS)+= nilfs2/
 obj-$(CONFIG_BEFS_FS)  += befs/
 obj-$(CONFIG_HOSTFS)   += hostfs/
-obj-$(CONFIG_HPPFS)+= hppfs/
 obj-$(CONFIG_CACHEFILES)   += cachefiles/
 obj-$(CONFIG_DEBUG_FS) += debugfs/
 obj-$(CONFIG_TRACING)  += tracefs/
diff --git a/fs/hppfs/Makefile b/fs/hppfs/Makefile
deleted file mode 100644
index 3a982bd..000
--- a/fs/hppfs/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# Copyright (C) 2002 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com)
-# Licensed under the GPL
-#
-
-obj-$(CONFIG_HPPFS) += hppfs.o
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
deleted file mode 100644
index 043ac9d..000
--- a/fs/hppfs/hppfs.c
+++ /dev/null
@@ -1,766 +0,0 @@
-/*
- * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
- * Licensed under the GPL
- */
-
-#include linux/ctype.h
-#include linux/dcache.h
-#include linux/file.h
-#include linux/fs.h
-#include linux/init.h
-#include linux/kernel.h
-#include linux/list.h
-#include linux/module.h
-#include linux/mount.h
-#include linux/slab.h
-#include linux/statfs.h
-#include linux/types.h
-#include linux/pid_namespace.h
-#include linux/namei.h
-#include asm/uaccess.h
-#include os.h
-
-static struct inode *get_inode(struct super_block *, struct dentry *);
-
-struct hppfs_data {
-   struct list_head list;
-   char contents[PAGE_SIZE - sizeof(struct list_head)];
-};
-
-struct hppfs_private {
-   struct file *proc_file;
-   int host_fd;
-   loff_t len;
-   struct hppfs_data *contents;
-};
-
-struct hppfs_inode_info {
-   struct dentry *proc_dentry;
-   struct inode vfs_inode;
-};
-
-static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode)
-{
-   return container_of(inode, struct hppfs_inode_info, vfs_inode);
-}
-
-#define HPPFS_SUPER_MAGIC 0xb0ee
-
-static const struct super_operations hppfs_sbops;
-
-static int is_pid(struct dentry *dentry)
-{
-   struct super_block *sb;
-   int i;
-
-   sb = dentry-d_sb;
-   if (dentry-d_parent != sb-s_root)
-   return 0;
-
-   for (i = 0; i  dentry-d_name.len; i++) {
-   if (!isdigit(dentry-d_name.name[i]))
-   return 0;
-   }
-   return 1;
-}
-
-static char *dentry_name(struct dentry *dentry, int extra)
-{
-   struct dentry *parent;
-   char *root, *name;
-   const char *seg_name;
-   int len, seg_len, root_len;
-
-   len = 0;
-   parent = dentry;
-   while (parent-d_parent != parent) {
-   if (is_pid(parent))
-   len += strlen(pid) + 1;
-   else len += parent-d_name.len + 1;
-   parent = parent-d_parent;
-   }
-
-   root = proc;
-   root_len = strlen(root);
-   len += root_len;
-   name = kmalloc(len + extra + 1, GFP_KERNEL);
-   if (name == NULL)
-   return NULL;
-
-   name[len] = '\0';
-   parent = dentry;
-   while (parent-d_parent != parent) {
-   if (is_pid(parent)) {
-   seg_name = pid;
-   seg_len = strlen(seg_name);
-   }
-   else {
-   seg_name = parent-d_name.name;
-   seg_len = parent-d_name.len;
-   }
-
-   

[uml-devel] Kill hppfs

2015-04-22 Thread Richard Weinberger
hch and Al found that hppfs has some serious issues[0].
As the filesystem as never marked as stable nor in heavy use
we decided to rip it out.
If someone is using it, speak up now. I plan to remove it in the v4.2
merge window.

Now we have FUSE which can be used to implement such a filesystem
in a sane way.

Thanks,
//richard

[0] https://lkml.org/lkml/2015/4/21/402

--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel