All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] decnet: fix shutdown parameter checking
@ 2012-08-27  2:37 Xi Wang
  2012-08-27  9:16 ` Steven Whitehouse
  0 siblings, 1 reply; 5+ messages in thread
From: Xi Wang @ 2012-08-27  2:37 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Xi Wang

The allowed value of "how" is SHUT_RD/SHUT_WR/SHUT_RDWR (0/1/2),
rather than SHUTDOWN_MASK (3).

Signed-off-by: Xi Wang <xi.wang@gmail.com>
---
 net/decnet/af_decnet.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 2ba1a28..307c322 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -1313,10 +1313,10 @@ static int dn_shutdown(struct socket *sock, int how)
 	if (scp->state == DN_O)
 		goto out;
 
-	if (how != SHUTDOWN_MASK)
+	if (how != SHUT_RDWR)
 		goto out;
 
-	sk->sk_shutdown = how;
+	sk->sk_shutdown = SHUTDOWN_MASK;
 	dn_destroy_sock(sk);
 	err = 0;
 
-- 
1.7.9.5


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

* Re: [PATCH] decnet: fix shutdown parameter checking
  2012-08-27  2:37 [PATCH] decnet: fix shutdown parameter checking Xi Wang
@ 2012-08-27  9:16 ` Steven Whitehouse
  2012-08-31 19:57   ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Whitehouse @ 2012-08-27  9:16 UTC (permalink / raw)
  To: Xi Wang; +Cc: David S. Miller, netdev, linux-kernel


On Sun, 2012-08-26 at 22:37 -0400, Xi Wang wrote:
> The allowed value of "how" is SHUT_RD/SHUT_WR/SHUT_RDWR (0/1/2),
> rather than SHUTDOWN_MASK (3).
> 
> Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>

Although it could be argued that we should also continue to accept the
value 3 just in case there is any userland software out there which
sends that value,

Steve.

> ---
>  net/decnet/af_decnet.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
> index 2ba1a28..307c322 100644
> --- a/net/decnet/af_decnet.c
> +++ b/net/decnet/af_decnet.c
> @@ -1313,10 +1313,10 @@ static int dn_shutdown(struct socket *sock, int how)
>  	if (scp->state == DN_O)
>  		goto out;
>  
> -	if (how != SHUTDOWN_MASK)
> +	if (how != SHUT_RDWR)
>  		goto out;
>  
> -	sk->sk_shutdown = how;
> +	sk->sk_shutdown = SHUTDOWN_MASK;
>  	dn_destroy_sock(sk);
>  	err = 0;
>  



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

* Re: [PATCH] decnet: fix shutdown parameter checking
  2012-08-27  9:16 ` Steven Whitehouse
@ 2012-08-31 19:57   ` David Miller
  2012-09-05  8:37     ` Steven Whitehouse
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-08-31 19:57 UTC (permalink / raw)
  To: swhiteho; +Cc: xi.wang, netdev, linux-kernel

From: Steven Whitehouse <swhiteho@redhat.com>
Date: Mon, 27 Aug 2012 10:16:41 +0100

> On Sun, 2012-08-26 at 22:37 -0400, Xi Wang wrote:
>> The allowed value of "how" is SHUT_RD/SHUT_WR/SHUT_RDWR (0/1/2),
>> rather than SHUTDOWN_MASK (3).
>> 
>> Signed-off-by: Xi Wang <xi.wang@gmail.com>
> Acked-by: Steven Whitehouse <swhiteho@redhat.com>

Applied to net-next.

> Although it could be argued that we should also continue to accept the
> value 3 just in case there is any userland software out there which
> sends that value,

True, but this is a rather standard BSD socket interface with a very
specific small set of legitimate input parameters.  Allowing
deviation, even for compatability for specific protocols, is largely
unwise.

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

* Re: [PATCH] decnet: fix shutdown parameter checking
  2012-08-31 19:57   ` David Miller
@ 2012-09-05  8:37     ` Steven Whitehouse
  2012-09-05 17:00       ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Whitehouse @ 2012-09-05  8:37 UTC (permalink / raw)
  To: David Miller; +Cc: xi.wang, netdev, linux-kernel

Hi,

On Fri, 2012-08-31 at 15:57 -0400, David Miller wrote:
> From: Steven Whitehouse <swhiteho@redhat.com>
> Date: Mon, 27 Aug 2012 10:16:41 +0100
> 
> > On Sun, 2012-08-26 at 22:37 -0400, Xi Wang wrote:
> >> The allowed value of "how" is SHUT_RD/SHUT_WR/SHUT_RDWR (0/1/2),
> >> rather than SHUTDOWN_MASK (3).
> >> 
> >> Signed-off-by: Xi Wang <xi.wang@gmail.com>
> > Acked-by: Steven Whitehouse <swhiteho@redhat.com>
> 
> Applied to net-next.
> 
> > Although it could be argued that we should also continue to accept the
> > value 3 just in case there is any userland software out there which
> > sends that value,
> 
> True, but this is a rather standard BSD socket interface with a very
> specific small set of legitimate input parameters.  Allowing
> deviation, even for compatability for specific protocols, is largely
> unwise.

Yes, I'd agree on the whole, and certainly if this was a recent
addition. However since this code has been around for somewhere close to
16 years now, I'd say that means that either (a) nobody calls shutdown
for DECnet or (b) existing users are buggy too.

We do have a precedent for this kind of compatibility, such as the AX.25
use of SOCK_SEQPACKET.

However, I'm not overly worried and we'll soon know if it will cause any
problems or not,

Steve.




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

* Re: [PATCH] decnet: fix shutdown parameter checking
  2012-09-05  8:37     ` Steven Whitehouse
@ 2012-09-05 17:00       ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2012-09-05 17:00 UTC (permalink / raw)
  To: swhiteho; +Cc: xi.wang, netdev, linux-kernel

From: Steven Whitehouse <swhiteho@redhat.com>
Date: Wed, 05 Sep 2012 09:37:56 +0100

> However, I'm not overly worried and we'll soon know if it will cause any
> problems or not,

You can be sure that if we get real bug reports due to this change, I will
revert it back to how it was before.

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

end of thread, other threads:[~2012-09-05 17:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-27  2:37 [PATCH] decnet: fix shutdown parameter checking Xi Wang
2012-08-27  9:16 ` Steven Whitehouse
2012-08-31 19:57   ` David Miller
2012-09-05  8:37     ` Steven Whitehouse
2012-09-05 17:00       ` David Miller

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.