mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cassella <pwc@speakeasy.net>
To: "David S. Miller" <davem@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-net@vger.kernel.org
Subject: Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process")
Date: Mon, 8 Jan 2001 01:16:27 -0600 (CST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0101080048460.2261-100000@localhost> (raw)
In-Reply-To: <200101080558.VAA02081@pizda.ninka.net>

On Sun, 7 Jan 2001, David S. Miller wrote:

>    Date: 	Sun, 7 Jan 2001 23:55:28 -0600 (CST)
>    From: Paul Cassella <pwc@speakeasy.net>
> 
>    [1.] One line summary of the problem:
> 
>    write() returns -1 and sets errno non-sensically.  2.4.0{,-ac[23]}
> 
> What you describe I can only say is "impossible".

Right.  That's why the code g_error()'s there.  :)

> None of them can occur via TCP socket writes (only netlink socket
> operations or socket control calls).

I didn't imagine that a TCP write could return any of these errors, which
is why I guessed that something's returning a value it thinks is positive,
but turns out to be negative in this case, for example, "return a - b;"
where due to, maybe, (but I guess not,) the peer shrunk window thing, a < b.

> Therefore I suspect you are perhaps getting rather some form of memory
> corruption or similar, really, please search the networking code for
> ESRCH value usage, you will see.

I believe that the tcp_sendmsg() path never tries to return -ESRCH, but I
don't see how userland memory corruption could cause the app to (1) open
such a socket instead of a TCP socket, and (2) get ESRCH or ENOEXEC
instead of EPERM or whatever a non-root process would get when it tried
such a thing.

I have seen no signs of bad memory on this machine, and of a fairly small
sample set, one (I was wrong when I said several) person is seeing the
same thing, with 2.4.0-test13-pre4, and I didn't see it with
2.4.0-test11-pre2.

The change I made to linux/fs/read_write.c:sys_write() checks

  file->f_op == &socket_file_ops

and then finds ret == -3; presumably this is the same 3 that my app gets.


Would it be more helpful if I were to check something like

  socki_lookup(file->f_dentry->f_inode)->ops == tcp_prot

instead?  Or do the check in tcp_sendmsg()?

-- 
Paul Cassella

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-08  7:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-08  5:55 Paul Cassella
2001-01-08  5:58 ` David S. Miller
2001-01-08  7:16   ` Paul Cassella [this message]
2001-01-08  7:05     ` David S. Miller
2001-01-08  6:35 ` Andi Kleen
2001-01-08  7:54   ` Paul Cassella
     [not found] <3A5B0A59.1EB60A88@uow.edu.au>
2001-01-09 14:03 ` Paul Cassella
2001-01-11 16:45   ` Paul Cassella
2001-01-11 17:18     ` David S. Miller
2001-01-12 10:52       ` 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH:"No " Andrew Morton

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=Pine.LNX.4.21.0101080048460.2261-100000@localhost \
    --to=pwc@speakeasy.net \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®