From nobody Fri Nov 04 18:06:22 2022 X-Original-To: dev-commits-src-all@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 4N3pTp2m7tz4hMYQ; Fri, 4 Nov 2022 18:06:22 +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 4N3pTp2HYrz3Wg2; Fri, 4 Nov 2022 18:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667585182; 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=Tqbq156LU9kCok/UUONLsyqWljf8mWvs5goncmVHbIw=; b=E+v8kOLlTjMHlaAMStcNwPmaVe/cGQ8+U96Bls1BphuUThlKngifUImNYTVBD6MHSSSnrx teb38kb9vdGUoFJKK3uyjqvftdallZXxg2Vcu9ePvOhp19Od6D/AvErsvyNtcD3v1dvAoe Eh+FXJYlsv+hMZ4C/UlmRf3qJsVwmgsuz7EXeyJVvZ+EAMNJ+R8EeTNYV4xafPKEC2q7pv 57wFG6JGdFZXoCNIpPBMlJ+eGdvC2zzXBOgY79kMWFr+1uCHxrdHVbj5W6v7mwVadzQ0ez ZbPpFRIGfp6t7MXHCqOYdI6H/B3O7Zv3vwl3N5SQvAgSGj+2K14L9yV9zA1k9w== 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 4N3pTp1M73z1QS9; Fri, 4 Nov 2022 18:06:22 +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 2A4I6MTl022776; Fri, 4 Nov 2022 18:06:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A4I6M0h022775; Fri, 4 Nov 2022 18:06:22 GMT (envelope-from git) Date: Fri, 4 Nov 2022 18:06:22 GMT Message-Id: <202211041806.2A4I6M0h022775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: ad370f7658ba - main - sound(4): Fix memory map of /dev/dsp devices when buffer size is not a multiple of PAGE_SIZE. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad370f7658ba59811d02c04032ac33ef787f752f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667585182; 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=Tqbq156LU9kCok/UUONLsyqWljf8mWvs5goncmVHbIw=; b=fDHlmll6FhA/OwDCltsVoRPfk+RtOliZry1bD3uf/vDcxvqW0siy7Bq9HPuhoq8h7Dvkxg bP2gFEFudedbn7EE2qxQRmtv5/G2d7+U77HzKd2hBp5G5rtQEpqtfvOPpc6f6IxdtpIARR mewgpyKUbIZNEg6wcW3hEORr02/4a+qzKvJw0v0pDOqAKiV/eEADAFOKH8YZg45mVmbX3O SRGXci7eCUBokVyj6JpOjW7BgEZBctQdlB865HLxTMTgzxBO/YNaTleAc2hMWaPLVBDjG6 wJBDQx0+oVk+8Be9PCOqzHMYdV1DvNFZ/zdld+MZpesDIjx0neeOpUduAr/Wfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667585182; a=rsa-sha256; cv=none; b=ZXc84H5VXz/TaI1q6p7JD7rtvmv/bltKnyc6O/ub+DSRB93Sx9pL1i8HhbmVmlArJoPZf2 cob9BR+IskLmsvEw2J4GWQjXmmV9fQddzeoyNy60loTeUaUBMEsS9yntqzK644DEIKGM++ C8Nrqydn2N3CApLQtwhbxOtwELgHfLUhQ5G7sMg8Id5Loqin2If85jNUnRWsH42d1lCjnQ OdeTXfdzfoCFtR5lqIFDG/ptnrld31bEu66T2VRax/tpyde+seWBlDYnqyExWTLPR2U6OJ tyU0zQVoTDnAr8kh6JiY6vHP68KigCgLV0zfLvSIBMMG6vxVHOWZMdRc/PGWSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ad370f7658ba59811d02c04032ac33ef787f752f commit ad370f7658ba59811d02c04032ac33ef787f752f Author: Florian Walpen AuthorDate: 2022-11-04 18:04:26 +0000 Commit: Hans Petter Selasky CommitDate: 2022-11-04 18:05:34 +0000 sound(4): Fix memory map of /dev/dsp devices when buffer size is not a multiple of PAGE_SIZE. By using sndbuf_getallocsize() instead of sndbuf_getsize() in dsp_mmap_single(). PR: 267555 MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/sound/pcm/dsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 15f437b8627c..cddc05206c4d 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2291,7 +2291,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, c = ((nprot & PROT_WRITE) != 0) ? wrch : rdch; if (c == NULL || (c->flags & CHN_F_MMAP_INVALID) || - (*offset + size) > sndbuf_getsize(c->bufsoft) || + (*offset + size) > sndbuf_getallocsize(c->bufsoft) || (wrch != NULL && (wrch->flags & CHN_F_MMAP_INVALID)) || (rdch != NULL && (rdch->flags & CHN_F_MMAP_INVALID))) { relchns(i_dev, rdch, wrch, SD_F_PRIO_RD | SD_F_PRIO_WR);