All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Florian Westphal <fw@strlen.de>
Cc: Ren Wei <enjou1224z@gmail.com>,
	netfilter-devel@vger.kernel.org, pablo@netfilter.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:03:43 +0200	[thread overview]
Message-ID: <akeXD_GwEFarWAuK@orbyte.nwl.cc> (raw)
In-Reply-To: <akeO-v0H9QP1psep@strlen.de>

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'

Cheers, Phil

  reply	other threads:[~2026-07-03 11:03 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 [this message]
2026-07-03 11:07             ` Pablo Neira Ayuso

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=akeXD_GwEFarWAuK@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --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=pablo@netfilter.org \
    --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 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.