mirror of
https://github.com/torvalds/linux.git
synced 2026-10-26 00:56:03 +01:00
The ffs()/fls() guard in ethnl_set_tsconfig() was meant to enforce that the user selects exactly one tx_type (and one rx_filter) at a time (off / none are explicit types with non-zero values). However, both ffs(0) and fls(0) return 0, so the guard passes a zero-valued bitset through. The subsequent ffs(req_tx_type) - 1 would produce -1, if user selected no bit. net_hwtstamp_validate() catches the invalid -1 downstream, but returns a generic error (-ERANGE) without telling the user what went wrong. Return -EINVAL + extack instead. Replace the ffs()/fls() comparison with a hweight32() == 1 check. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Joe Damato <joe@dama.to> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Link: https://patch.msgid.link/20260812162230.1837788-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> |
||
|---|---|---|
| .. | ||
| bitset.c | ||
| bitset.h | ||
| cabletest.c | ||
| channels.c | ||
| cmis_cdb.c | ||
| cmis_fw_update.c | ||
| cmis.h | ||
| coalesce.c | ||
| common.c | ||
| common.h | ||
| debug.c | ||
| eee.c | ||
| eeprom.c | ||
| features.c | ||
| fec.c | ||
| ioctl.c | ||
| linkinfo.c | ||
| linkmodes.c | ||
| linkstate.c | ||
| Makefile | ||
| mm.c | ||
| module_fw.h | ||
| module.c | ||
| mse.c | ||
| netlink.c | ||
| netlink.h | ||
| pause.c | ||
| phc_vclocks.c | ||
| phy.c | ||
| plca.c | ||
| privflags.c | ||
| pse-pd.c | ||
| rings.c | ||
| rss.c | ||
| stats.c | ||
| strset.c | ||
| ts.h | ||
| tsconfig.c | ||
| tsinfo.c | ||
| tunnels.c | ||
| wol.c | ||