From nobody Wed Jul 10 16:49:12 2024 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 4WK3jP3Mrqz5Qmt0; Wed, 10 Jul 2024 16:49:13 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WK3jN6zF0z4gnL; Wed, 10 Jul 2024 16:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630153; 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=xqNjYyqDjGhSGh3NF4EYA3L0TUDaJ162dpo6qv+tIw0=; b=nq53vSML/ug+9PtkJRjNpO4ZdeluuWHxJs08Je4Juai5DybR3O4MR82yWnILPumcOpJ6E2 Epa8xw/m5OKFFejGwskULB28BsCxHaeEB43GkRu/QU9UNTIA6OIA+ut4X8fNRQn375k2YA RkmUekQkptWiR6fcR58nGcbLwKB7tNkB6HP+kj1ryjg34orJ99RFrCVgZmM/XzwZGWpnrJ T6PpmsdUjs+ZWs7EAzIeYjijN+H2r67+SWuksOehEWY+AEdJU7SzqLwBwHbDgSDMRA8tjl iS+zT7lemM3eU0zXsZBzjn5McUjYcmlBDAVdNw4Dxm+tBq7tOhGO7/c4go0FiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630153; a=rsa-sha256; cv=none; b=Mr34JucqorF5c3fPVA+Ms01gvbwdEK39p8/QHCmV5Qc/hvUAu/uicP4npJ+gDuqHypF5jn KXgL+4sTa/NOyxkVB/6oz2d8LdqsklB+7KbtUS59lqEL+HStLaDwUXoYnYjDFwmK57C6e8 v9bLCs2MTPORk2dH6xgDkCHhKAh7eVUIWJ+rLQ92aGtf9XmR95/v+35SQtTR/LFnlxRWsT EMzvDO4nc2jByjxmLn2ZgiodGaDhsS/qeFVaQwuoxLbKgbOlvpCqCZB5WvX5ak+chLN59W m2CzBqS2Su2gFwkIIxZ5iX1fCfjWE9jr3+tR+hx02hWcw1ikF6TMdGbN3dgoAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630153; 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=xqNjYyqDjGhSGh3NF4EYA3L0TUDaJ162dpo6qv+tIw0=; b=BmiEYOGzgfpk4DjtcS/j8T3O8RRhOMRL6RHNg9x3QGovQI799dBTer0Z0M4xi4PcI3Y0l3 1HGhxrVR0IqTi6/2LrAnLo5yAJLxUmy3luc2SEfHoE8CzV2ykfgpbCNd03AtsbIZUWFsJY QZ8tAB2e6RMJQaklwR1oFpo0EwKVUw9z5SysC6RDDNR6QrU6nYNlvLjjdMRr0aOVYaAYV6 DnTqHHxFlfKQBxY/vhYOyBt8OkNFfNBBO+V6iJk1BChyMPH+6QH5eMoTCroqOTA2BdxmtE U0FDGi23dKalBFmW2FpsHqBhQJeJIFERzLgaNECsl5qZV7eFOYbwtK+zhPIyow== 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 4WK3jN5Tz2zPYV; Wed, 10 Jul 2024 16:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46AGnCkG035223; Wed, 10 Jul 2024 16:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGnC3r035220; Wed, 10 Jul 2024 16:49:12 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:12 GMT Message-Id: <202407101649.46AGnC3r035220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: efaa4bcc9283 - stable/14 - sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: efaa4bcc92835cd4208717d518cacd0aa6f8b1dd Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=efaa4bcc92835cd4208717d518cacd0aa6f8b1dd commit efaa4bcc92835cd4208717d518cacd0aa6f8b1dd Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:15 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO If the channel list is empty, min_rate and min_channels will be INT_MAX. Instead, assign them to 0, like we do in sndstat_get_caps(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45876 (cherry picked from commit 1a768ea9db3d66941b0dc5340ac028ef548808b8) --- sys/dev/sound/pcm/dsp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 0689dfedb9c2..2b765bc8b115 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2182,6 +2182,10 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) CHN_UNLOCK(ch); } + if (ai->min_rate == INT_MAX) + ai->min_rate = 0; + if (ai->min_channels == INT_MAX) + ai->min_channels = 0; PCM_UNLOCK(d);