* [bug report] drbd: replace genl_magic with explicit netlink serialization
@ 2026-05-19 6:24 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-05-19 6:24 UTC (permalink / raw)
To: Christoph Böhmwalder; +Cc: drbd-dev, linux-block
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-19 6:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 6:24 [bug report] drbd: replace genl_magic with explicit netlink serialization Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox