Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>
Cc: Florian Westphal <fw@strlen.de>, Ren Wei <enjou1224z@gmail.com>,
	netfilter-devel@vger.kernel.org, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com, horms@kernel.org,
	yuantan098@gmail.com, dstsmallbird@foxmail.com,
	chzhengyang2023@lzu.edu.cn
Subject: Re: [PATCH nf 1/1] netfilter: xt_time: reject pre-epoch calendar matching
Date: Fri, 3 Jul 2026 13:07:47 +0200	[thread overview]
Message-ID: <akeYAxWNWVhQz1wB@chamomile> (raw)
In-Reply-To: <akeXD_GwEFarWAuK@orbyte.nwl.cc>

On Fri, Jul 03, 2026 at 01:03:43PM +0200, Phil Sutter wrote:
> On Fri, Jul 03, 2026 at 12:29:14PM +0200, Florian Westphal wrote:
> > Phil Sutter <phil@nwl.cc> wrote:
> > > > This is silly.  I'm not sure this is even a bug.
> > > > We're in 2026 not 1970.  I really don't see why this patch is required.
> > > 
> > > I imagined a system with broken BIOS clock which boots at epoch until
> > > NTP has fixed it. Then stamp will be close to zero, no?
> > 
> > So what?  Rule won't match either way.  I wish we could get somehow
> > get rid of xt_time and nft_meta time matching, this was a very bad
> > idea from the start.
> 
> Sure, time-based packet matching won't work on a system with wrong time,
> but AIUI the patch is merely trying to prevent the unexpectedly large
> lshift. It seems harmless, though:
> - current_time.weekday can't exceed 7, it is assigned the result of a
>   modulo operation
> - current_time.monthday is type u8, so worst case the kernel will
>   compute '1U << 255'

Maybe it can be added as hardening for nf-next, just for correctness.
Remove Fixes: tag. I don't see this as a bug either.

      reply	other threads:[~2026-07-03 11:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1782879547.git.chzhengyang2023@lzu.edu.cn>
2026-07-03  7:32 ` [PATCH nf 1/1] netfilter: xt_time: reject pre-epoch calendar matching Ren Wei
2026-07-03  9:00   ` Phil Sutter
2026-07-03 10:08     ` Florian Westphal
2026-07-03 10:15       ` Phil Sutter
2026-07-03 10:29         ` Florian Westphal
2026-07-03 11:03           ` Phil Sutter
2026-07-03 11:07             ` Pablo Neira Ayuso [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=akeYAxWNWVhQz1wB@chamomile \
    --to=pablo@netfilter.org \
    --cc=chzhengyang2023@lzu.edu.cn \
    --cc=davem@davemloft.net \
    --cc=dstsmallbird@foxmail.com \
    --cc=edumazet@google.com \
    --cc=enjou1224z@gmail.com \
    --cc=fw@strlen.de \
    --cc=horms@kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phil@nwl.cc \
    --cc=yuantan098@gmail.com \
    /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