Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1571698pxb; Tue, 8 Feb 2022 22:41:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/ALhzvz6UOB3LsllYVQCZm7Jbpz1jHdvlb2GEhUsue8ms7TYG+34FLar944ZEGOr2aRcn X-Received: by 2002:a17:907:9808:: with SMTP id ji8mr675111ejc.12.1644388863757; Tue, 08 Feb 2022 22:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644388863; cv=none; d=google.com; s=arc-20160816; b=vobJ3nWpNIGwDljLjvuhetYqFjkFd49w1xKMnKBQPA6ZSXLrzZ8NA6Z/yD9gm0Rn+n smA0rPpZC3bZPj+SG/wn15kcsDVW5rpgyqCNWQjwcCEDopkrL7rDZCk2hWsPFPqJcTnC GAoZU6FuSoE3IfjshlCf0F5U/SgBcnDAOsifzmMIATY76+jgdcBE8kiXtBgeUjiqKNer LZzJyiwsjojkbDJYzPLwj0jEtClhFt4Ksjm1ejQgdTY6GO6CAjl5ym7gDhu3eKKkm0/G 1lHlEKi0Ofx1MQvrjc1deP1MLkB0KGkUCO0X+/kmnScK/n47Urk4uIDoix69QA4f5NPN uYQg== 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=WHeh8m0y3CKsGmtFwkMO2qIhrzq3cUMNuDH2f8SgMa2/DyLHTv2+ZcXDWyt8EfJRpy xWfNIDsiOpu2SiLAmePxigOE/h3fuiu4PW0q89Z/9rcTMNTcYwf0EOIMO/wfp7kiJ8OA h0DhWanZF2Y9HKayhroUSWqSB9hwr79baUPui2RpXUhRnc3de2IR9piPTXdnbYUkHisD 8147ljgHzGf4I6yed0cLAOyYN244mA9OfdrP8g7z2q0FQga0vVfaXFInBdjGxBOb6S3p dnZAtTAPhyy4EMtePgDiKZs5lk2JziuBjcgD7a0/fTpOtUIRQ+pxoDv+ybjchN6THufJ hO2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fpIsUQPV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id go41si157548ejc.450.2022.02.08.22.40.38; Tue, 08 Feb 2022 22:41:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fpIsUQPV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1378569AbiBGLf4 (ORCPT + 99 others); Mon, 7 Feb 2022 06:35:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358128AbiBGLZa (ORCPT ); Mon, 7 Feb 2022 06:25:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C2ADC043181; Mon, 7 Feb 2022 03:25:18 -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 ams.source.kernel.org (Postfix) with ESMTPS id C5C12B81158; Mon, 7 Feb 2022 11:25:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 172C2C004E1; Mon, 7 Feb 2022 11:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233115; bh=/hAnYNohmzw9oQdX6Kt9aR6iA/2JH1LYTQg7rMfMCQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fpIsUQPVyEfpYmxdSz6acPVCmnSlXRWkg+qDbQ1Jzp1PpO+XXrgfm3A7EUFi3If4M kxebcIP7OfX2+Pg9xfmdtEjMI4VupYgyOoy6Cb8sP6MM4S1hxcvDe7ay6vHIDTAXkX eBLoZmMl2sfr489W6Q3djawNbvttoUxtj14wazJc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown Subject: [PATCH 5.15 009/110] ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx() Date: Mon, 7 Feb 2022 12:05:42 +0100 Message-Id: <20220207103802.594628456@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103802.280120990@linuxfoundation.org> References: <20220207103802.280120990@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;