cpuset: Fix the KASAN and KMSAN builds
Rename the "copyin" and "copyout" fields of struct cpuset_copy_cb to something less generic, since sanitizers define interceptors for copyin() and copyout() using #define. Reported by: syzbot+2db5d644097fc698fb6f@syzkaller.appspotmail.com Fixes: 47a57144af25 ("cpuset: Byte swap cpuset for compat32 on big endian architectures") Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
b3fa36efe7
commit
4a3e51335e
sys
@ -3364,8 +3364,8 @@ copyout32_set(const void *k, void *u, size_t size)
|
||||
}
|
||||
|
||||
static const struct cpuset_copy_cb cpuset_copy32_cb = {
|
||||
.copyin = copyin32_set,
|
||||
.copyout = copyout32_set
|
||||
.cpuset_copyin = copyin32_set,
|
||||
.cpuset_copyout = copyout32_set
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -2240,8 +2240,8 @@ linux_sched_getparam(struct thread *td,
|
||||
}
|
||||
|
||||
static const struct cpuset_copy_cb copy_set = {
|
||||
.copyin = copyin,
|
||||
.copyout = copyout
|
||||
.cpuset_copyin = copyin,
|
||||
.cpuset_copyout = copyout
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -1744,8 +1744,8 @@ cpuset_check_capabilities(struct thread *td, cpulevel_t level, cpuwhich_t which,
|
||||
}
|
||||
|
||||
static const struct cpuset_copy_cb copy_set = {
|
||||
.copyin = copyin,
|
||||
.copyout = copyout
|
||||
.cpuset_copyin = copyin,
|
||||
.cpuset_copyout = copyout
|
||||
};
|
||||
|
||||
#ifndef _SYS_SYSPROTO_H_
|
||||
@ -1983,7 +1983,7 @@ kern_cpuset_getaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which,
|
||||
goto out;
|
||||
}
|
||||
size = min(cpusetsize, sizeof(cpuset_t));
|
||||
error = cb->copyout(mask, maskp, size);
|
||||
error = cb->cpuset_copyout(mask, maskp, size);
|
||||
if (error != 0)
|
||||
goto out;
|
||||
if (cpusetsize > size) {
|
||||
@ -2123,7 +2123,7 @@ user_cpuset_setaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which,
|
||||
|
||||
size = min(cpusetsize, sizeof(cpuset_t));
|
||||
mask = malloc(sizeof(cpuset_t), M_TEMP, M_WAITOK | M_ZERO);
|
||||
error = cb->copyin(maskp, mask, size);
|
||||
error = cb->cpuset_copyin(maskp, mask, size);
|
||||
if (error)
|
||||
goto out;
|
||||
/*
|
||||
@ -2275,7 +2275,7 @@ kern_cpuset_getdomain(struct thread *td, cpulevel_t level, cpuwhich_t which,
|
||||
}
|
||||
DOMAINSET_COPY(&outset.ds_mask, mask);
|
||||
if (error == 0)
|
||||
error = cb->copyout(mask, maskp, domainsetsize);
|
||||
error = cb->cpuset_copyout(mask, maskp, domainsetsize);
|
||||
if (error == 0)
|
||||
if (suword32(policyp, outset.ds_policy) != 0)
|
||||
error = EFAULT;
|
||||
@ -2326,7 +2326,7 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t level, cpuwhich_t which,
|
||||
return (error);
|
||||
memset(&domain, 0, sizeof(domain));
|
||||
mask = malloc(domainsetsize, M_TEMP, M_WAITOK | M_ZERO);
|
||||
error = cb->copyin(maskp, mask, domainsetsize);
|
||||
error = cb->cpuset_copyin(maskp, mask, domainsetsize);
|
||||
if (error)
|
||||
goto out;
|
||||
/*
|
||||
|
@ -159,8 +159,8 @@ struct thread;
|
||||
* ABIs, like compat32.
|
||||
*/
|
||||
struct cpuset_copy_cb {
|
||||
int (*copyin)(const void *, void *, size_t);
|
||||
int (*copyout)(const void *, void *, size_t);
|
||||
int (*cpuset_copyin)(const void *, void *, size_t);
|
||||
int (*cpuset_copyout)(const void *, void *, size_t);
|
||||
};
|
||||
|
||||
struct cpuset *cpuset_thread0(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user