From: Florian Westphal <fw@strlen.de>
To: Jeremy Sowden <jeremy@azazel.net>
Cc: Netfilter Devel <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH ulogd2 v3 0/2] pcap: prevent crashes when output `FILE *` is null
Date: Fri, 17 Mar 2023 00:36:19 +0100 [thread overview]
Message-ID: <20230316233619.GA26650@breakpoint.cc> (raw)
In-Reply-To: <20230316110754.260967-1-jeremy@azazel.net>
Jeremy Sowden <jeremy@azazel.net> wrote:
> If ulogd2 receives a signal it will attempt to re-open the pcap output
> file. If this fails (because the permissions or ownership have changed
> for example), the FILE pointer will be null and when the next packet
> comes in, the null pointer will be passed to fwrite and ulogd will
> crash.
>
> The first patch simplifies the logic of the code that opens the output
> file, and the second avoids closing the existing stream if `fopen`
> fails.
>
> Link: https://bugs.launchpad.net/ubuntu/+source/ulogd2/+bug/1429778
>
> Change since v2
>
> * The first patch is new.
> * In the second patch, just keep the old stream open, rather than
> disabling output and trying to reopen at intervals.
Applied, please double-check the mangling done in patch #1 and send
a followup fix if needed.
next prev parent reply other threads:[~2023-03-16 23:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 11:07 [PATCH ulogd2 v3 0/2] pcap: prevent crashes when output `FILE *` is null Jeremy Sowden
2023-03-16 11:07 ` [PATCH ulogd2 v3 1/2] pcap: simplify opening of output file Jeremy Sowden
2023-03-16 11:24 ` Florian Westphal
2023-03-16 11:32 ` Florian Westphal
2023-03-16 19:02 ` Pablo Neira Ayuso
2023-03-16 19:09 ` Jeremy Sowden
2023-03-16 11:07 ` [PATCH ulogd2 v3 2/2] pcap: prevent crashes when output `FILE *` is null Jeremy Sowden
2023-03-16 11:36 ` [PATCH ulogd2 v3 0/2] " Florian Westphal
2023-03-16 23:36 ` Florian Westphal [this message]
2023-03-17 11:34 ` Jeremy Sowden
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=20230316233619.GA26650@breakpoint.cc \
--to=fw@strlen.de \
--cc=jeremy@azazel.net \
--cc=netfilter-devel@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 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.