Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261469AbUKSQZJ (ORCPT ); Fri, 19 Nov 2004 11:25:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261460AbUKSQY7 (ORCPT ); Fri, 19 Nov 2004 11:24:59 -0500 Received: from mx1.redhat.com ([66.187.233.31]:61877 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S261472AbUKSQYU (ORCPT ); Fri, 19 Nov 2004 11:24:20 -0500 Date: Fri, 19 Nov 2004 11:24:03 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Alan Cox cc: Ross Kendall Axe , , Stephen Smalley , lkml , Chris Wright , "David S. Miller" Subject: Re: [PATCH] linux 2.9.10-rc1: Fix oops in unix_dgram_sendmsg when using SELinux and SOCK_SEQPACKET In-Reply-To: <1100864358.8127.5.camel@localhost.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1190 Lines: 42 On Fri, 19 Nov 2004, Alan Cox wrote: > Looks right to me, the ECONNRESET is no longer being lost. Ok, here is a relative patch for Dave. Please apply. Signed-off-by: James Morris --- diff -purN -X dontdiff linux-2.6.10-rc2.w2/net/unix/af_unix.c linux-2.6.10-rc2.w3/net/unix/af_unix.c --- linux-2.6.10-rc2.w2/net/unix/af_unix.c 2004-11-18 12:09:44.000000000 -0500 +++ linux-2.6.10-rc2.w3/net/unix/af_unix.c 2004-11-18 21:54:12.000000000 -0500 @@ -1513,13 +1513,18 @@ out_err: static int unix_seqpacket_sendmsg(struct kiocb *kiocb, struct socket *sock, struct msghdr *msg, size_t len) { + int err; struct sock *sk = sock->sk; + err = sock_error(sk); + if (err) + return err; + if (sk->sk_state != TCP_ESTABLISHED) return -ENOTCONN; - if (msg->msg_name || msg->msg_namelen) - return -EINVAL; + if (msg->msg_namelen) + msg->msg_namelen = 0; return unix_dgram_sendmsg(kiocb, sock, msg, len); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/