From nobody Fri May 20 14:36:32 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8648A1B37349; Fri, 20 May 2022 14:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L4TnD3MQNz3hlp; Fri, 20 May 2022 14:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653057392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E6/WPCYGAYgmIZ5uucuIsecR5cCQWZGiKn+5mJhGIiE=; b=FIwvPoCiho9vX214X77nl+Oo22A86N1ocpORSs6OpvzEBf2qoC4fRCkIPtYmAkwlVKCwBZ BW6eE3Z9ivSAdMvTswxxpWGVOxpRHJi+87Ij3SPPadwtHOKJkLfXjDukVrN6tuChWje6nT 0B5lB/ok/luoKBLx4ifiV3LgKl/0HIYb9CVhZwfYobiqgJ8yZhNjB5st8QVnnEGSyISuBj 8kZlQNNenQq87lh9eUekGXxZ3NHrh3tiip1Cp6zmKobwN6vjaWMby+nYVNz5MDHDK920HF fzZP6npCD6cugMYJPws12k+VLWcTZdBc4TLPhqg3DhC1Q+OwlGCboe2v2XXpYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 533551413B; Fri, 20 May 2022 14:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24KEaWO9027986; Fri, 20 May 2022 14:36:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24KEaWPc027985; Fri, 20 May 2022 14:36:32 GMT (envelope-from git) Date: Fri, 20 May 2022 14:36:32 GMT Message-Id: <202205201436.24KEaWPc027985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 4a3e51335e86 - main - cpuset: Fix the KASAN and KMSAN builds List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a3e51335e86cee02569c04b9f1e95ca9abcb170 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653057392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E6/WPCYGAYgmIZ5uucuIsecR5cCQWZGiKn+5mJhGIiE=; b=tgXeFe94XKc6CjEx4VwOxrDsT3vmGudWircY7ZAdt4mMVlJhcEghu7Oa884W1BkpWW+EPC nYB1111Que9XDE++LkLAnUWNcLogC8WGkYlwsLLal2AGbGeCyoIrdbv1bG5GpABL4rjqOG 3RIfXjEvrvLb8xaGLYP00iKwJrA7sGDpwProxT8sopoQNoMIkpOieV9Kb1+Em+8KHucdYu qhacQ6Iq50kozGeUUafdd4IEc1V0PSF3wZe//x1R0EfN0Ui+lJPW42RIpCS50XSv1+AJh3 Flk9jyQZfdRyPnE7YGUws5QizCCdfcQdl/kkSzaD747qcfaUNOVRoQdDHyTl0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653057392; a=rsa-sha256; cv=none; b=TCMgtXJHDirb51Yg6nUkB5V/LU9gd3lWtXL9DWyXLrpx29e0sYmjll1AcZ5Xw5vE/k+vUQ /OCoIW0dPrFQysuEGGxx01GhugfAPwh4fJvBpXEAEvpj2Scagh3DHlIx61hu3yk33c53rQ RZkd4aFps4GeM6njUtDRmZCOqiplqq6ILbw3vRiTaobNALBEFCB0l3EGaiBr89T0HVhicf qKm9lvR/01Gm7ZNhXr2aaA1NppbF03dwotjMKmA98m9BM8EOg5R3twyVHulcWA1HSR3vRG u+SGiwhI4zHHaoTOhXq8hboosJMuAI7gOVKQWBIlliSeU4CMheXHOlNJoOgHRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4a3e51335e86cee02569c04b9f1e95ca9abcb170 commit 4a3e51335e86cee02569c04b9f1e95ca9abcb170 Author: Mark Johnston AuthorDate: 2022-05-20 14:11:31 +0000 Commit: Mark Johnston CommitDate: 2022-05-20 14:34:25 +0000 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 --- sys/compat/freebsd32/freebsd32_misc.c | 4 ++-- sys/compat/linux/linux_misc.c | 4 ++-- sys/kern/kern_cpuset.c | 12 ++++++------ sys/sys/cpuset.h | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index d4206fdd24aa..46e4ffb39525 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -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 diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 652a9b4b5067..7ea4b8481220 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -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 }; /* diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index e21ec146bb00..a5c644687241 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -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; /* diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h index 4f55cdc27103..5df5cff6497b 100644 --- a/sys/sys/cpuset.h +++ b/sys/sys/cpuset.h @@ -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);