All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] syscalls/bind03: Bugfix for running with option "-i"
Date: Mon, 10 May 2021 16:54:45 +0200	[thread overview]
Message-ID: <YJlJNdi039jziyCp@yuki> (raw)
In-Reply-To: <20210508021448.7390-1-zhaogongyi@huawei.com>

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.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2021-05-10 14:54 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 [this message]
2021-05-10 17:15   ` Petr Vorel

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=YJlJNdi039jziyCp@yuki \
    --to=chrubis@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.