All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] syscalls/bind03: Bugfix for running with option "-i"
Date: Mon, 10 May 2021 19:15:08 +0200	[thread overview]
Message-ID: <YJlqHBd+OVdqwEke@pevik> (raw)
In-Reply-To: <YJlJNdi039jziyCp@yuki>

Hi,

> Hi!
> I was looking at the test wondering why do you try to unlink socket that
> wasn't bind properly and it looks like kernel creates the socket even in
> a case that the bind fails, which is strange and I would call it a bug.

> Looking at the kernel code it indeed does mknod before it takes locks
> and checks the socket. Even more it turns out that there is in-flight
> patchset that is fixing this:

> https://lore.kernel.org/netdev/YDQAmH9zSsaqf+Dg@zeniv-ca.linux.org.uk/

> Anyways for now moved the code initializing the sockets into a setup()
> function and the only call that had to stay in the run() function is the
> unlink(SNAME_B); with a comment that kernel is buggy.

> And we will have to write a regression test for this bug once upstream
> kernel is fixed.

> Also note that I use unlink() here since the test will fail otherwise
> once kernel is fixed and there is no socket to be unlinked.

FYI I created issue #817 for it, feel free to improve the description.

https://github.com/linux-test-project/ltp/issues/814

Kind regards,
Petr

      reply	other threads:[~2021-05-10 17:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  2:14 [LTP] [PATCH v2] syscalls/bind03: Bugfix for running with option "-i" Zhao Gongyi
2021-05-10 14:54 ` Cyril Hrubis
2021-05-10 17:15   ` Petr Vorel [this message]

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=YJlqHBd+OVdqwEke@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 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.