Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ve: stale 've isn't running' comment in netlink_ve_capable()
  after init_cred change
--

commit 0ce43e99309aa75e8847e7c9d6dca465801086bf
Author: Vladimir Riabchun <[email protected]>

ve: Defer ve creds drop until ve is completely destroyed

The patch moves put_cred() and the init_cred = NULL store out of
ve_drop_context() and into a new ve_drop_cred(), which ve_destroy() now
calls. This keeps ve->init_cred alive while a dead VE still has users, such
as an overlayfs superblock.

> diff --git a/kernel/capability.c b/kernel/capability.c
> index 6de4dcba2283..68c3d5288ba7 100644
> --- a/kernel/capability.c
> +++ b/kernel/capability.c
> @@ -395,7 +395,7 @@ bool ve_capable(int cap)
>       rcu_read_lock();
>       cred = ve->init_cred;
>  
> -     if (cred == NULL) /* ve isn't running */
> +     if (cred == NULL) /* ve isn't started */
>               cred = ve0.init_cred;

[Severity: Low]
This isn't a bug, but the same NULL-init_cred fallback in
netlink_ve_capable() in net/netlink/af_netlink.c still says "ve isn't
running". Since init_cred now stays set after the VE stops or dies, and NULL
means only that the VE was never started, should that comment be reworded
to match?

The commit message also doesn't say that capability checks against a dead VE
no longer fall back to ve0.init_cred. That looks like the intended effect, so
could it be mentioned?

-- 
Sashiko AI review ยท 
https://sashiko.vzint.dev/#/patchset/[email protected]?part=3

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to