diff options
| author | Fredric Cover <fredric.cover.lkernel@gmail.com> | 2026-09-02 17:49:01 -0700 |
|---|---|---|
| committer | Paulo Alcantara <pc@manguebit.org> | 2026-09-03 11:49:15 -0300 |
| commit | 42d3358bf145f27d32350037e67d3527e9098c1e (patch) | |
| tree | 97f3b1ac9bf377550de0fb655befa0c63093fd2d /scripts/basic/split-include.c | |
| parent | d806d5a85dcbe2a0f181b2f0f9f61ddfbefa1818 (diff) | |
| download | linux-42d3358bf145f27d32350037e67d3527e9098c1e.tar.gz linux-42d3358bf145f27d32350037e67d3527e9098c1e.zip | |
smb: client: fill cache fields after populating cache in copy_ref_data()
In copy_ref_data(), struct cache_entry *ce has its fields populated
at the beginning of the function. Later, if alloc_target fails with
an ERR_PTR, free_tgts() is called on the cache, leaving the cache
metadata populated without any targets. Critically, this extends
ce->etime, making the cache appear valid for longer without any
targets.
Also, free_tgts() does not set ce->numtgts to zero. On error, when
the cache is freed, ce->numtgts is not zeroed, and other cache users
may attempt to access nonexistent entries.
Update fields after copying targets to prevent partial-state updates.
Set ce->numtgts to zero at the end of free_tgts().
Signed-off-by: Fredric Cover <fredric.cover.lkernel@gmail.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
