summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorTung Nguyen <tung.quang.nguyen@est.tech>2026-10-29 10:04:48 +0700
committerJakub Kicinski <kuba@kernel.org>2026-10-30 19:03:37 -0700
commit0a0257228be902ff09608bcaf19ae7c6d58b028f (patch)
treeb841f3fdebf9dd19bfaf2f99db70cbfa852aeedd /rust/kernel/alloc/kvec/errors.rs
parent162cf592b577cccf04515100563e819d9eba5c4a (diff)
tipc: reject attaching bearer of different media to the same occupied device
Currently, two bearers of different media types can be added to the same device (e.g., "eth:eth0" and "ib:eth0") via tipc command: tipc bearer enable media eth dev eth0 tipc bearer enable media ib dev eth0 For each command execution, tipc_enable_l2_media() is called: tipc_enable_l2_media() dev_get_by_name() dev_hold() As a result, device->dev_refcnt is incremented twice, but the second bearer replaces the first one. This causes a leak in device->dev_refcnt. Fix this by rejecting a bearer with a different media type when the device is already occupied. Fixes: cb30a63384bc ("tipc: refactor function tipc_enable_bearer()") Reported-by: Jiakai Xu <xujiakai24@mails.ucas.ac.cn> Closes: http://lore.kernel.org/netdev/20260918013509.1853952-1-xujiakai24@mails.ucas.ac.cn/ Signed-off-by: Tung Nguyen <tung.quang.nguyen@est.tech> Link: https://patch.msgid.link/20261029030522.8306-1-tung.quang.nguyen@est.tech Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions