[PATCH 0/3] Miscellaneous small fixes
Here's a handful of small fixes for passt I came across while working on other things. David Gibson (3): conf: Fix incorrect bounds checking for sock_path parameter gitignore README.plain.md Don't unnecessarily avoid CLOEXEC flags .gitignore | 1 + conf.c | 12 ++++-------- passt.c | 6 ++---- pasta.c | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) -- 2.37.2
Looks like a copy-paste error where we're checking against the size of the
pcap field, rather than the sock_path field.
Signed-off-by: David Gibson
Add the generated README.plain.md file to .gitignore.
Signed-off-by: David Gibson
There are several places in the passt code where we have lint overrides
because we're not adding CLOEXEC flags to open or other operations.
Comments suggest this is because it's before we fork() into the background
but we'll need those file descriptors after we're in the background.
However, as the name suggests CLOEXEC closes on exec(), not on fork(). The
only place we exec() is either super early invoke the avx2 version of the
binary, or when we start a shell in pasta mode, which certainly *doesn't*
require the fds in question.
Add the CLOEXEC flag in those places, and remove the lint overrides.
Signed-off-by: David Gibson
On Tue, 23 Aug 2022 16:31:51 +1000
David Gibson
There are several places in the passt code where we have lint overrides because we're not adding CLOEXEC flags to open or other operations. Comments suggest this is because it's before we fork() into the background but we'll need those file descriptors after we're in the background.
However, as the name suggests CLOEXEC closes on exec(), not on fork().
...after looking into it and trying to remember: it seems like the only reason why I skipped O_CLOEXEC here was some bogus innate assumption I had about file descriptors being closed on clone() too. Thanks for spotting this. -- Stefano
On Tue, 23 Aug 2022 16:31:48 +1000
David Gibson
Here's a handful of small fixes for passt I came across while working on other things.
David Gibson (3): conf: Fix incorrect bounds checking for sock_path parameter gitignore README.plain.md Don't unnecessarily avoid CLOEXEC flags
Applied! -- Stefano
participants (2)
-
David Gibson
-
Stefano Brivio