From: Dan Carpenter <error27@gmail.com>
To: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
Cc: drbd-dev@lists.linbit.com, linux-block@vger.kernel.org
Subject: [bug report] drbd: replace genl_magic with explicit netlink serialization
Date: Tue, 19 May 2026 09:24:44 +0300 [thread overview]
Message-ID: <agwCLACUZdi_GnKZ@stanley.mountain> (raw)
Hello Christoph Böhmwalder,
Commit 8098eeb693c4 ("drbd: replace genl_magic with explicit netlink
serialization") from May 6, 2026 (linux-next), leads to the following
Smatch static checker warning:
drivers/block/drbd/drbd_nl_gen.c:1859 drbd_cfg_reply_to_skb()
warn: unsigned 's->info_text_len' is never less than zero.
drivers/block/drbd/drbd_nl_gen.c
1852 int drbd_cfg_reply_to_skb(struct sk_buff *skb, struct drbd_cfg_reply *s)
1853 {
1854 struct nlattr *tla = nla_nest_start(skb, DRBD_NLA_CFG_REPLY);
1855
1856 if (!tla)
1857 goto nla_put_failure;
1858
--> 1859 if (nla_put(skb, DRBD_A_DRBD_CFG_REPLY_INFO_TEXT, min_t(int, 0,
1860 s->info_text_len + (s->info_text_len < 0)), s->info_text))
^^^^^^^^^^^^^^^^^^^^
This is a u32 so it can't be negative.
1861 goto nla_put_failure;
1862
1863 nla_nest_end(skb, tla);
1864 return 0;
1865
1866 nla_put_failure:
1867 if (tla)
1868 nla_nest_cancel(skb, tla);
1869 return -EMSGSIZE;
1870 }
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
reply other threads:[~2026-05-19 6:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=agwCLACUZdi_GnKZ@stanley.mountain \
--to=error27@gmail.com \
--cc=christoph.boehmwalder@linbit.com \
--cc=drbd-dev@lists.linbit.com \
--cc=linux-block@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox