All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] sys_sysfs: Add CONFIG_SYSFS_SYSCALL
@ 2014-02-13 14:09 Fabian Frederick
  2014-02-13 22:31 ` Dave Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Fabian Frederick @ 2014-02-13 14:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, rdunlap

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

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/filesystems.c |  2 ++
 init/Kconfig     | 10 ++++++++++
 kernel/sys_ni.c  |  1 +
 3 files changed, 13 insertions(+)

diff --git a/fs/filesystems.c b/fs/filesystems.c
index 92567d9..5797d45 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -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)
 {
diff --git a/init/Kconfig b/init/Kconfig
index 009a797..013d13c 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -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
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 7078052..74395a9 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -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);
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] sys_sysfs: Add CONFIG_SYSFS_SYSCALL
  2014-02-13 14:09 [PATCH 1/1] sys_sysfs: Add CONFIG_SYSFS_SYSCALL Fabian Frederick
@ 2014-02-13 22:31 ` Dave Jones
  2014-02-13 22:38   ` Greg KH
  2014-02-13 22:43   ` Andrew Morton
  0 siblings, 2 replies; 6+ messages in thread
From: Dave Jones @ 2014-02-13 22:31 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, akpm, rdunlap, gregkh

On Thu, Feb 13, 2014 at 10:09:42PM +0800, Fabian Frederick wrote:
 > 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
 > 
 > Signed-off-by: Fabian Frederick <fabf@skynet.be>
 > ---
 >  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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] sys_sysfs: Add CONFIG_SYSFS_SYSCALL
  2014-02-13 22:31 ` Dave Jones
@ 2014-02-13 22:38   ` Greg KH
  2014-02-13 22:41     ` Dave Jones
  2014-02-13 22:43   ` Andrew Morton
  1 sibling, 1 reply; 6+ messages in thread
From: Greg KH @ 2014-02-13 22:38 UTC (permalink / raw)
  To: Dave Jones, Fabian Frederick, linux-kernel, akpm, rdunlap

On Thu, Feb 13, 2014 at 05:31:41PM -0500, Dave Jones wrote:
> On Thu, Feb 13, 2014 at 10:09:42PM +0800, Fabian Frederick wrote:
>  > 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
>  > 
>  > Signed-off-by: Fabian Frederick <fabf@skynet.be>
>  > ---
>  >  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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] sys_sysfs: Add CONFIG_SYSFS_SYSCALL
  2014-02-13 22:38   ` Greg KH
@ 2014-02-13 22:41     ` Dave Jones
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Jones @ 2014-02-13 22:41 UTC (permalink / raw)
  To: Greg KH; +Cc: Fabian Frederick, linux-kernel, akpm, rdunlap

On Thu, Feb 13, 2014 at 02:38:32PM -0800, Greg KH wrote:
 > On Thu, Feb 13, 2014 at 05:31:41PM -0500, Dave Jones wrote:
 > > On Thu, Feb 13, 2014 at 10:09:42PM +0800, Fabian Frederick wrote:
 > >  > 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
 > >  > 
 > >  > Signed-off-by: Fabian Frederick <fabf@skynet.be>
 > >  > ---
 > >  >  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 :)

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] sys_sysfs: Add CONFIG_SYSFS_SYSCALL
  2014-02-13 22:31 ` Dave Jones
  2014-02-13 22:38   ` Greg KH
@ 2014-02-13 22:43   ` Andrew Morton
  2014-02-19 12:49     ` Fabian Frederick
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2014-02-13 22:43 UTC (permalink / raw)
  To: Dave Jones; +Cc: Fabian Frederick, linux-kernel, rdunlap, gregkh

On Thu, 13 Feb 2014 17:31:41 -0500 Dave Jones <davej@redhat.com> wrote:

> On Thu, Feb 13, 2014 at 10:09:42PM +0800, Fabian Frederick wrote:
>  > 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
>  > 
>  > Signed-off-by: Fabian Frederick <fabf@skynet.be>
>  > ---
>  >  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.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] sys_sysfs: Add CONFIG_SYSFS_SYSCALL
  2014-02-13 22:43   ` Andrew Morton
@ 2014-02-19 12:49     ` Fabian Frederick
  0 siblings, 0 replies; 6+ messages in thread
From: Fabian Frederick @ 2014-02-19 12:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Dave Jones, linux-kernel, rdunlap, gregkh

On Thu, 13 Feb 2014 14:43:19 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Thu, 13 Feb 2014 17:31:41 -0500 Dave Jones <davej@redhat.com> wrote:
> 
> > On Thu, Feb 13, 2014 at 10:09:42PM +0800, Fabian Frederick wrote:
> >  > 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
> >  > 
> >  > Signed-off-by: Fabian Frederick <fabf@skynet.be>
> >  > ---
> >  >  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.
> 
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-19 20:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 14:09 [PATCH 1/1] sys_sysfs: Add CONFIG_SYSFS_SYSCALL Fabian Frederick
2014-02-13 22:31 ` Dave Jones
2014-02-13 22:38   ` Greg KH
2014-02-13 22:41     ` Dave Jones
2014-02-13 22:43   ` Andrew Morton
2014-02-19 12:49     ` Fabian Frederick

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.