Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1315760pxb; Tue, 8 Feb 2022 14:29:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKyyb6uZxf5xTaJrw8wBlnkSp5LT/1koJcGioseNAveUbhQjk9Ao+DmuY6nB7JcdOyW++g X-Received: by 2002:a63:4e58:: with SMTP id o24mr5201264pgl.374.1644359387161; Tue, 08 Feb 2022 14:29:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644359387; cv=none; d=google.com; s=arc-20160816; b=zchhgPIGw9EeHoWXa9Vb3tfNx/YfmxVKVEqwx3lhbvfPOw78Isrl+T3hiagroPm/kI GizvsnrNCLmP8CqwvIL/LUpvxjx56df+SpIn7DurG1ePkaMnFVT87KydkgClveTgcM+c QXRx1BYrp6+O1LuM4vOKHS06biXrc4dLLrhYlGCsgNT0hX8mzTCWDb3ZzIwwzZYEq7yc DsJ2MW/OWHiQ+x+lKQRHU0gSFxt8eCqQ3wtqmFuWgu3a/g8UOcf+1A04SQe7egHH7U7/ v9MAaxSUubZtyWuLVGhX79tSTAivEIVgAAWFgKw7lhezNNVRf+9KyXKsbmIYeKsDYE41 yMZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ApsbGg1K/w4f+IG0J5C0RPnTv2HcoW6M+zpNp9Tmgr0=; b=Yk3sA1Z7JTWMuV+gaWgJiAScPVZ+J8UNSQEeiv+2NTb0p2iCFxQ2tTTFjtE7Yv02e+ aKfqeL3mTMatFyAX1enQKlHQoSeGuoT4oSJjB51vxko+oQ0kb5JPxiKDMKuyDnVNDDrN PvnVXZOEm2RtfIZiuvgNeX9oUGCX8LBsy7+QE9h8iC0NitHfcrP0gcrJ94vlT8pcDffb idEh/2yU800KZYV/9oP91wJxIuDtFPXHttIq3C5/8qLchfh35eZFzDAPBCYjY/YilkcO u2/W/zDbqtUGes+8araKXAc+mnzdl6I/fdOl9YiKCBPcjwm7VGRsg8VNt5m+eNCm9EWs k+Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="xg/DDpwg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z21si13226855plo.378.2022.02.08.14.29.33; Tue, 08 Feb 2022 14:29:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="xg/DDpwg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391160AbiBGL6h (ORCPT + 99 others); Mon, 7 Feb 2022 06:58:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385637AbiBGLcE (ORCPT ); Mon, 7 Feb 2022 06:32:04 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16140C03C190; Mon, 7 Feb 2022 03:31:21 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A56E560A67; Mon, 7 Feb 2022 11:31:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69A07C340EB; Mon, 7 Feb 2022 11:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233480; bh=/hAnYNohmzw9oQdX6Kt9aR6iA/2JH1LYTQg7rMfMCQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xg/DDpwgtmJJ3dWWn6TkfAhohJ5iubJY2PVbMBhiEfPs1HEkw+LF6aJ0eLLZSfMZ6 JOaxuN80+1wHdbWuD5OVsXyQotBTlBUvBUWimXofezIsWcsf1Hna8vsMOgCCPanbWX /lYymyUtsfO6dTv+jRAaH2efuh/1687vu8qYV648= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown Subject: [PATCH 5.16 009/126] ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx() Date: Mon, 7 Feb 2022 12:05:40 +0100 Message-Id: <20220207103804.379642678@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103804.053675072@linuxfoundation.org> References: <20220207103804.053675072@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Brown commit 4cf28e9ae6e2e11a044be1bcbcfa1b0d8675fe4d upstream. We don't currently validate that the values being set are within the range we advertised to userspace as being valid, do so and reject any values that are out of range. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220124153253.3548853-4-broonie@kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-ops.c | 2 ++ 1 file changed, 2 insertions(+) --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -879,6 +879,8 @@ int snd_soc_put_xr_sx(struct snd_kcontro long val = ucontrol->value.integer.value[0]; unsigned int i; + if (val < mc->min || val > mc->max) + return -EINVAL; if (invert) val = max - val; val &= mask;