Skip to contentSkip to conversation

sys_sysfs: Add CONFIG_SYSFS_SYSCALL

PATCH In review Fabian Frederick 4 participants 6 messages Feb 13, 2014 – Feb 19, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sys_sysfs: Add CONFIG_SYSFS_SYSCALL

sys_sysfs is an obsolete system call no longer supported by libc ... -This patch adds a default CONFIG_SYSFS_SYSCALL=y
-Option can be turned off in expert mode.
-cond_syscall added to kernel/sys_ni.c

---
 fs/filesystems.c |  2 ++
 init/Kconfig     | 10 ++++++++++
 kernel/sys_ni.c  |  1 +
 3 files changed, 13 insertions(+)
fs/filesystems.c +2 -0
index 92567d9..5797d45 100644
@@ -121,6 +121,7 @@ int unregister_filesystem(struct file_system_type * fs)
 
 EXPORT_SYMBOL(unregister_filesystem);
 
+#ifdef CONFIG_SYSFS_SYSCALL
 static int fs_index(const char __user * __name)
 {
 	struct file_system_type * tmp;
@@ -199,6 +200,7 @@ SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2)
 	}
 	return retval;
 }
+#endif
 
 int __init get_filesystem_list(char *buf)
 {
init/Kconfig +10 -0
index 009a797..013d13c 100644
@@ -1290,6 +1290,16 @@ config UID16
 	help
 	  This enables the legacy 16-bit UID syscall wrappers.
 
+config SYSFS_SYSCALL
+	bool "Sysfs syscall support" if EXPERT
+	default y
+	---help---
+	  sys_sysfs is an obsolete system call no longer supported in
+	  libc.Note that disabling this option while being more secure breaks
+	  compatibility with other systems.
+
+	  If unsure say Y here.
+
 config SYSCTL_SYSCALL
 	bool "Sysctl syscall support" if EXPERT
 	depends on PROC_SYSCTL
kernel/sys_ni.c +1 -0
index 7078052..74395a9 100644
@@ -146,6 +146,7 @@ cond_syscall(sys_io_destroy);
 cond_syscall(sys_io_submit);
 cond_syscall(sys_io_cancel);
 cond_syscall(sys_io_getevents);
+cond_syscall(sys_sysfs);
 cond_syscall(sys_syslog);
 cond_syscall(sys_process_vm_readv);
 cond_syscall(sys_process_vm_writev);
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 11 lines · Fabian Frederick

sys_sysfs is an obsolete system call no longer supported by libc ...

(quoted diff) +0 -3
-This patch adds a default CONFIG_SYSFS_SYSCALL=y
-Option can be turned off in expert mode.
-cond_syscall added to kernel/sys_ni.c
---
 fs/filesystems.c |  2 ++
 init/Kconfig     | 10 ++++++++++
 kernel/sys_ni.c  |  1 +
 3 files changed, 13 insertions(+)

did anyone ever ship userspace that actually used that syscall ?
Some ancient version of udev that probably doesn't work on a modern kernel anyway maybe ?

I wonder if it's something we can make -ENOSYS unconditionally at some point, and remove all that code entirely.

Dave

#2 lore raw
Quoted 6 lines · Dave Jones
Quoted 5 lines · Fabian Frederick

sys_sysfs is an obsolete system call no longer supported by libc ...

(quoted diff) +0 -3
-This patch adds a default CONFIG_SYSFS_SYSCALL=y
-Option can be turned off in expert mode.
-cond_syscall added to kernel/sys_ni.c
Quoted 9 lines
Quoted 6 lines
---
 fs/filesystems.c |  2 ++
 init/Kconfig     | 10 ++++++++++
 kernel/sys_ni.c  |  1 +
 3 files changed, 13 insertions(+)

did anyone ever ship userspace that actually used that syscall ?
Some ancient version of udev that probably doesn't work on a modern kernel anyway maybe ?

sys_sysfs doesn't have anything to do with /sys/ and udev in any way that I know of, it's a much older thing, a sysv syscall that can return the index, name, or max index of a filesystem.

And yes, I got confused by it all the time when creating sysfs :)

thanks,

greg k-h

#3 lore raw
Quoted 14 lines · Greg KH
Quoted 13 lines · Dave Jones
Quoted 11 lines · Fabian Frederick

sys_sysfs is an obsolete system call no longer supported by libc ...

(quoted diff) +0 -3
-This patch adds a default CONFIG_SYSFS_SYSCALL=y
-Option can be turned off in expert mode.
-cond_syscall added to kernel/sys_ni.c
---
 fs/filesystems.c |  2 ++
 init/Kconfig     | 10 ++++++++++
 kernel/sys_ni.c  |  1 +
 3 files changed, 13 insertions(+)
Quoted 8 lines
Quoted 2 lines

did anyone ever ship userspace that actually used that syscall ?
Some ancient version of udev that probably doesn't work on a modern kernel anyway maybe ?

sys_sysfs doesn't have anything to do with /sys/ and udev in any way that I know of, it's a much older thing, a sysv syscall that can return the index, name, or max index of a filesystem.

And yes, I got confused by it all the time when creating sysfs :)

ah, Now I realise I've also made this mistake before. Tricky.

I wonder if anything does still use it though..
*goes to grep all of Fedora source*

Dave

#4 lore raw
In reply to Dave Jones
Quoted 16 lines · On Thu, 13 Feb 2014 17:31:41 -0500 Dave Jones <[email protected]> wrote:
Quoted 11 lines · Fabian Frederick

sys_sysfs is an obsolete system call no longer supported by libc ...

(quoted diff) +0 -3
-This patch adds a default CONFIG_SYSFS_SYSCALL=y
-Option can be turned off in expert mode.
-cond_syscall added to kernel/sys_ni.c
---
 fs/filesystems.c |  2 ++
 init/Kconfig     | 10 ++++++++++
 kernel/sys_ni.c  |  1 +
 3 files changed, 13 insertions(+)

did anyone ever ship userspace that actually used that syscall ?
Some ancient version of udev that probably doesn't work on a modern kernel anyway maybe ?

Quoted 2 lines

I wonder if it's something we can make -ENOSYS unconditionally at some point, and remove all that code entirely.

Perhaps we could make it `default n' now and see if we receive nastygrams?

#5 lore raw
Quoted 15 lines · On Thu, 13 Feb 2014 14:43:19 -0800 Andrew Morton <[email protected]>…
Quoted 13 lines · On Thu, 13 Feb 2014 17:31:41 -0500 Dave Jones <[email protected]> wrote:
Quoted 11 lines · Fabian Frederick

sys_sysfs is an obsolete system call no longer supported by libc ...

(quoted diff) +0 -3
-This patch adds a default CONFIG_SYSFS_SYSCALL=y
-Option can be turned off in expert mode.
-cond_syscall added to kernel/sys_ni.c
---
 fs/filesystems.c |  2 ++
 init/Kconfig     | 10 ++++++++++
 kernel/sys_ni.c  |  1 +
 3 files changed, 13 insertions(+)
Quoted 7 lines
Quoted 5 lines

did anyone ever ship userspace that actually used that syscall ?
Some ancient version of udev that probably doesn't work on a modern kernel anyway maybe ?

I wonder if it's something we can make -ENOSYS unconditionally at some point, and remove all that code entirely.

Perhaps we could make it `default n' now and see if we receive nastygrams?

As it seems very old, maybe we wouldn't have any trouble for users in linux-next but it could break something when going in stable (?).Having that patch with functions enabled by default will give us time to test it and have a pointer to it to remove later...

Fabian