* [PATCH] do not give access to 1-1024 ports for autobinding
@ 2007-10-10 14:34 Denis V. Lunev
2007-10-10 15:41 ` Stephen Hemminger
2007-10-10 22:52 ` David Miller
0 siblings, 2 replies; 7+ messages in thread
From: Denis V. Lunev @ 2007-10-10 14:34 UTC (permalink / raw)
To: davem; +Cc: netdev, den
This patch prevents possibility to give 1-1024 port range for autobinding.
{1, 1} may only takes some sense for deep embedded people.
Signed-off-by: Denis V. Lunev <den@openvz.org>
--- ./net/ipv4/sysctl_net_ipv4.c.port2 2007-10-10 17:46:48.000000000 +0400
+++ ./net/ipv4/sysctl_net_ipv4.c 2007-10-10 18:08:00.000000000 +0400
@@ -25,7 +25,7 @@ extern int sysctl_ip_nonlocal_bind;
#ifdef CONFIG_SYSCTL
static int zero;
static int tcp_retr1_max = 255;
-static int ip_local_port_range_min[] = { 1, 1 };
+static int ip_local_port_range_min[] = { 1024, 1024 };
static int ip_local_port_range_max[] = { 65535, 65535 };
#endif
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] do not give access to 1-1024 ports for autobinding
2007-10-10 14:34 [PATCH] do not give access to 1-1024 ports for autobinding Denis V. Lunev
@ 2007-10-10 15:41 ` Stephen Hemminger
2007-10-10 16:59 ` Denis V. Lunev
2007-10-10 22:51 ` David Miller
2007-10-10 22:52 ` David Miller
1 sibling, 2 replies; 7+ messages in thread
From: Stephen Hemminger @ 2007-10-10 15:41 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: davem, netdev, den
On Wed, 10 Oct 2007 18:34:49 +0400
"Denis V. Lunev" <den@openvz.org> wrote:
> This patch prevents possibility to give 1-1024 port range for autobinding.
> {1, 1} may only takes some sense for deep embedded people.
>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
>
> --- ./net/ipv4/sysctl_net_ipv4.c.port2 2007-10-10 17:46:48.000000000 +0400
> +++ ./net/ipv4/sysctl_net_ipv4.c 2007-10-10 18:08:00.000000000 +0400
> @@ -25,7 +25,7 @@ extern int sysctl_ip_nonlocal_bind;
> #ifdef CONFIG_SYSCTL
> static int zero;
> static int tcp_retr1_max = 255;
> -static int ip_local_port_range_min[] = { 1, 1 };
> +static int ip_local_port_range_min[] = { 1024, 1024 };
> static int ip_local_port_range_max[] = { 65535, 65535 };
> #endif
>
> -
That only limits the sysctl, which seems completely counter productive.
Sounds like more of the "stop root from shooting themselves" patches.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] do not give access to 1-1024 ports for autobinding
2007-10-10 15:41 ` Stephen Hemminger
@ 2007-10-10 16:59 ` Denis V. Lunev
2007-10-10 17:12 ` Stephen Hemminger
2007-10-10 22:55 ` David Miller
2007-10-10 22:51 ` David Miller
1 sibling, 2 replies; 7+ messages in thread
From: Denis V. Lunev @ 2007-10-10 16:59 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Denis V. Lunev, davem, netdev
Stephen Hemminger wrote:
> On Wed, 10 Oct 2007 18:34:49 +0400
> "Denis V. Lunev" <den@openvz.org> wrote:
>
>> This patch prevents possibility to give 1-1024 port range for autobinding.
>> {1, 1} may only takes some sense for deep embedded people.
>>
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>>
>> --- ./net/ipv4/sysctl_net_ipv4.c.port2 2007-10-10 17:46:48.000000000 +0400
>> +++ ./net/ipv4/sysctl_net_ipv4.c 2007-10-10 18:08:00.000000000 +0400
>> @@ -25,7 +25,7 @@ extern int sysctl_ip_nonlocal_bind;
>> #ifdef CONFIG_SYSCTL
>> static int zero;
>> static int tcp_retr1_max = 255;
>> -static int ip_local_port_range_min[] = { 1, 1 };
>> +static int ip_local_port_range_min[] = { 1024, 1024 };
>> static int ip_local_port_range_max[] = { 65535, 65535 };
>> #endif
>>
>> -
>
> That only limits the sysctl, which seems completely counter productive.
> Sounds like more of the "stop root from shooting themselves" patches.
>
They have sense for the case of multiple network namespaces, where root
in the other namespace can be treated as a user to initial namespace.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] do not give access to 1-1024 ports for autobinding
2007-10-10 16:59 ` Denis V. Lunev
@ 2007-10-10 17:12 ` Stephen Hemminger
2007-10-10 22:55 ` David Miller
1 sibling, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2007-10-10 17:12 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: Denis V. Lunev, davem, netdev
On Wed, 10 Oct 2007 20:59:13 +0400
"Denis V. Lunev" <dlunev@gmail.com> wrote:
> Stephen Hemminger wrote:
> > On Wed, 10 Oct 2007 18:34:49 +0400
> > "Denis V. Lunev" <den@openvz.org> wrote:
> >
> >> This patch prevents possibility to give 1-1024 port range for autobinding.
> >> {1, 1} may only takes some sense for deep embedded people.
> >>
> >> Signed-off-by: Denis V. Lunev <den@openvz.org>
> >>
> >> --- ./net/ipv4/sysctl_net_ipv4.c.port2 2007-10-10 17:46:48.000000000 +0400
> >> +++ ./net/ipv4/sysctl_net_ipv4.c 2007-10-10 18:08:00.000000000 +0400
> >> @@ -25,7 +25,7 @@ extern int sysctl_ip_nonlocal_bind;
> >> #ifdef CONFIG_SYSCTL
> >> static int zero;
> >> static int tcp_retr1_max = 255;
> >> -static int ip_local_port_range_min[] = { 1, 1 };
> >> +static int ip_local_port_range_min[] = { 1024, 1024 };
> >> static int ip_local_port_range_max[] = { 65535, 65535 };
> >> #endif
> >>
> >> -
> >
> > That only limits the sysctl, which seems completely counter productive.
> > Sounds like more of the "stop root from shooting themselves" patches.
> >
>
> They have sense for the case of multiple network namespaces, where root
> in the other namespace can be treated as a user to initial namespace.
IMHO don't want to treat root as a complete idiot like normal users.
As long as what root requests doesn't create a security problem, it
should be allowed. The port space is per namespace right? The sysctl
values should be per namespace as well.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] do not give access to 1-1024 ports for autobinding
2007-10-10 15:41 ` Stephen Hemminger
2007-10-10 16:59 ` Denis V. Lunev
@ 2007-10-10 22:51 ` David Miller
1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2007-10-10 22:51 UTC (permalink / raw)
To: shemminger; +Cc: den, netdev
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Wed, 10 Oct 2007 08:41:37 -0700
> On Wed, 10 Oct 2007 18:34:49 +0400
> "Denis V. Lunev" <den@openvz.org> wrote:
>
> > This patch prevents possibility to give 1-1024 port range for autobinding.
> > {1, 1} may only takes some sense for deep embedded people.
> >
> > Signed-off-by: Denis V. Lunev <den@openvz.org>
> >
> > --- ./net/ipv4/sysctl_net_ipv4.c.port2 2007-10-10 17:46:48.000000000 +0400
> > +++ ./net/ipv4/sysctl_net_ipv4.c 2007-10-10 18:08:00.000000000 +0400
> > @@ -25,7 +25,7 @@ extern int sysctl_ip_nonlocal_bind;
> > #ifdef CONFIG_SYSCTL
> > static int zero;
> > static int tcp_retr1_max = 255;
> > -static int ip_local_port_range_min[] = { 1, 1 };
> > +static int ip_local_port_range_min[] = { 1024, 1024 };
> > static int ip_local_port_range_max[] = { 65535, 65535 };
> > #endif
> >
> > -
>
> That only limits the sysctl, which seems completely counter productive.
> Sounds like more of the "stop root from shooting themselves" patches.
Agreed, we shouldn't be changing these values.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] do not give access to 1-1024 ports for autobinding
2007-10-10 14:34 [PATCH] do not give access to 1-1024 ports for autobinding Denis V. Lunev
2007-10-10 15:41 ` Stephen Hemminger
@ 2007-10-10 22:52 ` David Miller
1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2007-10-10 22:52 UTC (permalink / raw)
To: den; +Cc: netdev
From: "Denis V. Lunev" <den@openvz.org>
Date: Wed, 10 Oct 2007 18:34:49 +0400
> This patch prevents possibility to give 1-1024 port range for autobinding.
> {1, 1} may only takes some sense for deep embedded people.
>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
Administrators can configure their systems however they want,
the numbers are valid port numbers, so we should not prevent
the possibility.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] do not give access to 1-1024 ports for autobinding
2007-10-10 16:59 ` Denis V. Lunev
2007-10-10 17:12 ` Stephen Hemminger
@ 2007-10-10 22:55 ` David Miller
1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2007-10-10 22:55 UTC (permalink / raw)
To: dlunev; +Cc: shemminger, den, netdev
From: "Denis V. Lunev" <dlunev@gmail.com>
Date: Wed, 10 Oct 2007 20:59:13 +0400
> They have sense for the case of multiple network namespaces, where root
> in the other namespace can be treated as a user to initial namespace.
This is a silly limitation to impose just for the sake of
namespaces, please don't add it.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-10-10 22:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-10 14:34 [PATCH] do not give access to 1-1024 ports for autobinding Denis V. Lunev
2007-10-10 15:41 ` Stephen Hemminger
2007-10-10 16:59 ` Denis V. Lunev
2007-10-10 17:12 ` Stephen Hemminger
2007-10-10 22:55 ` David Miller
2007-10-10 22:51 ` David Miller
2007-10-10 22:52 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).