public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] SYSCTL: export root handling routines
@ 2011-12-12 18:49 Stanislav Kinsbursky
  2011-12-12 18:50 ` [PATCH 1/2] SYSCTL: root unregister routine introduced Stanislav Kinsbursky
  2011-12-12 18:50 ` [PATCH 2/2] SYSCTL: export root register and unregister routines Stanislav Kinsbursky
  0 siblings, 2 replies; 6+ messages in thread
From: Stanislav Kinsbursky @ 2011-12-12 18:49 UTC (permalink / raw)
  To: mingo
  Cc: a.p.zijlstra, xemul, drosenberg, linux-kernel, eparis, bfields,
	jbottomley, akpm, devel

These rouitines are required to make SUNRPC sysctl's network-namespace-aware.

The following series consists of:

---

Stanislav Kinsbursky (2):
      SYSCTL: root unregister routine introduced
      SYSCTL: export root register and unregister routines


 kernel/sysctl.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)



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

* [PATCH 1/2] SYSCTL: root unregister routine introduced
  2011-12-12 18:49 [PATCH 0/2] SYSCTL: export root handling routines Stanislav Kinsbursky
@ 2011-12-12 18:50 ` Stanislav Kinsbursky
  2011-12-12 22:52   ` Andrew Morton
  2011-12-12 18:50 ` [PATCH 2/2] SYSCTL: export root register and unregister routines Stanislav Kinsbursky
  1 sibling, 1 reply; 6+ messages in thread
From: Stanislav Kinsbursky @ 2011-12-12 18:50 UTC (permalink / raw)
  To: mingo
  Cc: a.p.zijlstra, xemul, drosenberg, linux-kernel, eparis, bfields,
	jbottomley, akpm, devel

This routine is required for SUNRPC sysctl's, which are going to be allocated,
processed and destroyed per network namespace context.
IOW, new sysctl root will be registered on network namespace creation and
thus have to unregistered before network namespace destruction.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>

---
 kernel/sysctl.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index ae27196..21e68c1 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1701,6 +1701,13 @@ void register_sysctl_root(struct ctl_table_root *root)
 	spin_unlock(&sysctl_lock);
 }
 
+void unregister_sysctl_root(struct ctl_table_root *root)
+{
+	spin_lock(&sysctl_lock);
+	list_del(&root->root_list);
+	spin_unlock(&sysctl_lock);
+}
+
 /*
  * sysctl_perm does NOT grant the superuser all rights automatically, because
  * some sysctl variables are readonly even to root.


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

* [PATCH 2/2] SYSCTL: export root register and unregister routines
  2011-12-12 18:49 [PATCH 0/2] SYSCTL: export root handling routines Stanislav Kinsbursky
  2011-12-12 18:50 ` [PATCH 1/2] SYSCTL: root unregister routine introduced Stanislav Kinsbursky
@ 2011-12-12 18:50 ` Stanislav Kinsbursky
  1 sibling, 0 replies; 6+ messages in thread
From: Stanislav Kinsbursky @ 2011-12-12 18:50 UTC (permalink / raw)
  To: mingo
  Cc: a.p.zijlstra, xemul, drosenberg, linux-kernel, eparis, bfields,
	jbottomley, akpm, devel

These routines will be used in SUNPRC module and thus have to be exported.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>

---
 kernel/sysctl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 21e68c1..0ee5b73 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1700,6 +1700,7 @@ void register_sysctl_root(struct ctl_table_root *root)
 	list_add_tail(&root->root_list, &sysctl_table_root.root_list);
 	spin_unlock(&sysctl_lock);
 }
+EXPORT_SYMBOL_GPL(register_sysctl_root);
 
 void unregister_sysctl_root(struct ctl_table_root *root)
 {
@@ -1707,6 +1708,7 @@ void unregister_sysctl_root(struct ctl_table_root *root)
 	list_del(&root->root_list);
 	spin_unlock(&sysctl_lock);
 }
+EXPORT_SYMBOL_GPL(unregister_sysctl_root);
 
 /*
  * sysctl_perm does NOT grant the superuser all rights automatically, because


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

* Re: [PATCH 1/2] SYSCTL: root unregister routine introduced
  2011-12-12 18:50 ` [PATCH 1/2] SYSCTL: root unregister routine introduced Stanislav Kinsbursky
@ 2011-12-12 22:52   ` Andrew Morton
  2011-12-13  9:02     ` Stanislav Kinsbursky
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2011-12-12 22:52 UTC (permalink / raw)
  To: Stanislav Kinsbursky
  Cc: mingo, a.p.zijlstra, xemul, drosenberg, linux-kernel, eparis,
	bfields, jbottomley, devel

On Mon, 12 Dec 2011 21:50:00 +0300
Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:

> This routine is required for SUNRPC sysctl's, which are going to be allocated,
> processed and destroyed per network namespace context.
> IOW, new sysctl root will be registered on network namespace creation and
> thus have to unregistered before network namespace destruction.
> 

It's a bit suspicious that such a mature subsystem as sysctl newly
needs its internals exported like this.  Either a) the net namespaces
work is doing something which hasn't been done before or b) it is doing
something wrong.

So, please explain further so we can confirm that it is a) and not b).

> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -1701,6 +1701,13 @@ void register_sysctl_root(struct ctl_table_root *root)
>  	spin_unlock(&sysctl_lock);
>  }
>  
> +void unregister_sysctl_root(struct ctl_table_root *root)
> +{
> +	spin_lock(&sysctl_lock);
> +	list_del(&root->root_list);
> +	spin_unlock(&sysctl_lock);
> +}
> +

This requires the addition of a declaration to include/linux/sysctl.h.

Once that is done and review is complete, I'd suggest that these two
patches be joined into a single patch, and that patch become part of
whatever patch series it is which needs them.


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

* Re: [PATCH 1/2] SYSCTL: root unregister routine introduced
  2011-12-12 22:52   ` Andrew Morton
@ 2011-12-13  9:02     ` Stanislav Kinsbursky
  2011-12-17 22:30       ` Eric W. Biederman
  0 siblings, 1 reply; 6+ messages in thread
From: Stanislav Kinsbursky @ 2011-12-13  9:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: mingo@elte.hu, a.p.zijlstra@chello.nl, Pavel Emelianov,
	drosenberg@vsecurity.com, linux-kernel@vger.kernel.org,
	eparis@redhat.com, bfields@fieldses.org, James Bottomley,
	devel@openvz.org

13.12.2011 02:52, Andrew Morton пишет:
> On Mon, 12 Dec 2011 21:50:00 +0300
> Stanislav Kinsbursky<skinsbursky@parallels.com>  wrote:
>
>> This routine is required for SUNRPC sysctl's, which are going to be allocated,
>> processed and destroyed per network namespace context.
>> IOW, new sysctl root will be registered on network namespace creation and
>> thus have to unregistered before network namespace destruction.
>>
>
> It's a bit suspicious that such a mature subsystem as sysctl newly
> needs its internals exported like this.  Either a) the net namespaces
> work is doing something which hasn't been done before or b) it is doing
> something wrong.
>
> So, please explain further so we can confirm that it is a) and not b).
>

Hello, Andrew.
The goal is to provide an ability to control and modify data by sysctl's in 
network namespace context. This is done by "net" sysctl's.
But there are two more issues to solve:
1) Sysctl's have to be in /proc/sys/sunrpc
2) Sysctl's content should be accessible from creator's network context (not 
current user ones's).

>> --- a/kernel/sysctl.c
>> +++ b/kernel/sysctl.c
>> @@ -1701,6 +1701,13 @@ void register_sysctl_root(struct ctl_table_root *root)
>>   	spin_unlock(&sysctl_lock);
>>   }
>>
>> +void unregister_sysctl_root(struct ctl_table_root *root)
>> +{
>> +	spin_lock(&sysctl_lock);
>> +	list_del(&root->root_list);
>> +	spin_unlock(&sysctl_lock);
>> +}
>> +
>
> This requires the addition of a declaration to include/linux/sysctl.h.
>
> Once that is done and review is complete, I'd suggest that these two
> patches be joined into a single patch, and that patch become part of
> whatever patch series it is which needs them.
>

Ok, I'll do so.

-- 
Best regards,
Stanislav Kinsbursky

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

* Re: [PATCH 1/2] SYSCTL: root unregister routine introduced
  2011-12-13  9:02     ` Stanislav Kinsbursky
@ 2011-12-17 22:30       ` Eric W. Biederman
  0 siblings, 0 replies; 6+ messages in thread
From: Eric W. Biederman @ 2011-12-17 22:30 UTC (permalink / raw)
  To: Stanislav Kinsbursky
  Cc: Andrew Morton, mingo@elte.hu, a.p.zijlstra@chello.nl,
	Pavel Emelianov, drosenberg@vsecurity.com,
	linux-kernel@vger.kernel.org, eparis@redhat.com,
	bfields@fieldses.org, James Bottomley, devel@openvz.org

Stanislav Kinsbursky <skinsbursky@parallels.com> writes:

> 13.12.2011 02:52, Andrew Morton пишет:
>> On Mon, 12 Dec 2011 21:50:00 +0300
>> Stanislav Kinsbursky<skinsbursky@parallels.com>  wrote:
>>
>>> This routine is required for SUNRPC sysctl's, which are going to be allocated,
>>> processed and destroyed per network namespace context.
>>> IOW, new sysctl root will be registered on network namespace creation and
>>> thus have to unregistered before network namespace destruction.
>>>
>>
>> It's a bit suspicious that such a mature subsystem as sysctl newly
>> needs its internals exported like this.  Either a) the net namespaces
>> work is doing something which hasn't been done before or b) it is doing
>> something wrong.
>>
>> So, please explain further so we can confirm that it is a) and not b).
>>
>
> Hello, Andrew.
> The goal is to provide an ability to control and modify data by sysctl's in
> network namespace context. This is done by "net" sysctl's.
> But there are two more issues to solve:
> 1) Sysctl's have to be in /proc/sys/sunrpc

The sysctl root has nothing to with what directory the files show up in,
so this should not be an issue.

> 2) Sysctl's content should be accessible from creator's network context (not
> current user ones's).

Making the sunrpc sysctls per network namespace would seem to address
this.    I don't see why you would need a new root to handle this case.

Eric

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

end of thread, other threads:[~2011-12-17 22:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12 18:49 [PATCH 0/2] SYSCTL: export root handling routines Stanislav Kinsbursky
2011-12-12 18:50 ` [PATCH 1/2] SYSCTL: root unregister routine introduced Stanislav Kinsbursky
2011-12-12 22:52   ` Andrew Morton
2011-12-13  9:02     ` Stanislav Kinsbursky
2011-12-17 22:30       ` Eric W. Biederman
2011-12-12 18:50 ` [PATCH 2/2] SYSCTL: export root register and unregister routines Stanislav Kinsbursky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox