mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haofeng Li <920484857@qq.com>
To: qmo@kernel.org
Cc: 13266079573@163.com, 920484857@qq.com, andrii@kernel.org,
	ast@kernel.org, daniel@iogearbox.net, lihaofeng@kylinos.cn,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bpf: fix netfilter link comparison to handle unsigned flags
Date: Mon, 22 Sep 2025 09:45:32 +0800	[thread overview]
Message-ID: <tencent_07A006DB31D2CB8040AF8B2C4CBBC25E7D06@qq.com> (raw)
In-Reply-To: <72f0108c-ce6c-4f89-b04d-2398d7c808a5@kernel.org>

Thank you for your review and feedback.

>Did you actually observe an overflow producing an error when sorting, 
>here? Or did you run into some compiler warning?

I did not encounter a runtime error or a compiler warning caused by this potential overflow. 
The issue was identified during code review as a potential risk, 
considering the theoretical possibility of wrap-around with unsigned subtraction, 
which prompted me to submit this patch for code robustness.

>This being said, I don't mind making the code cleaner for these
>comparisons, but we should probably treat all three attributes the same,
>and update the rest of the function as well?

Thank you for pointing this out. 
I will prepare a v2 patch that thoroughly reviews and updates the comparison 
logic for all three fields (netfilter.pf, netfilter.hooknum, and netfilter.flags), 
replacing all subtraction-based comparisons with explicit conditional checks. 
This will ensure the entire comparison function is robust and consistent in its behavior.

Best regards,
	Haofeng Li


  reply	other threads:[~2025-09-22  1:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19  9:04 Haofeng Li
2025-09-20  0:22 ` Quentin Monnet
2025-09-22  1:45   ` Haofeng Li [this message]
2025-09-22  2:20     ` Alexei Starovoitov

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=tencent_07A006DB31D2CB8040AF8B2C4CBBC25E7D06@qq.com \
    --to=920484857@qq.com \
    --cc=13266079573@163.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=lihaofeng@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qmo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®