The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Hua Zhong" <hzhong@gmail.com>
To: "'Tony Griffiths'" <tonyg@agile.tv>, <linux-kernel@vger.kernel.org>
Subject: RE: Some socket syscalls fail to return an error on bad file-descriptor# argument
Date: Wed, 31 May 2006 21:33:00 -0700	[thread overview]
Message-ID: <003801c68534$7bfdc4e0$0200a8c0@nuitysystems.com> (raw)
In-Reply-To: <447E614F.3090905@agile.tv>

This has been fixed in 2.6.17. 

> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org 
> [mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Tony 
> Griffiths
> Sent: Wednesday, May 31, 2006 8:39 PM
> To: linux-kernel@vger.kernel.org
> Subject: Some socket syscalls fail to return an error on bad 
> file-descriptor# argument
> 
> Description:
> 
> The sockfd_lookup_light() function does not set the return 
> error status on a particular failure mode when the passed-in 
> fd# is erroneous.
> 
> Environment:
> 
> 2.6.16 kernel with the -mm2 patch-set applied.  Linux 2.6.17 
> kernels are also affected.  Without the fix, a number of 
> tests in LTP fail!  Any program calling one of the syscalls 
> listed below with a bad fd# will not get an error return 
> indicating that the syscall failed.
> 
> Fix:
> 
> The attached patch correctly sets *err = -EBADF if the 
> attempt to map the fd# to a file pointer returns NULL.  The 
> following syscalls are
> affected-
> 
> bind()
> listen()
> accept()
> connect()
> getsockname()
> getpeername()
> setsockopt()
> setsockopt()
> shutdown()
> sendmsg()
> recvmsg()
> 
> 
> 
> 


  reply	other threads:[~2006-06-01  4:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-01  3:38 Some socket syscalls fail to return an error on bad file-descriptor# argument Tony Griffiths
2006-06-01  4:33 ` Hua Zhong [this message]
2006-06-01  4:41 ` Andrew Morton
2006-06-01  7:21   ` James Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003801c68534$7bfdc4e0$0200a8c0@nuitysystems.com' \
    --to=hzhong@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tonyg@agile.tv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox