Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1681899pxb; Wed, 9 Feb 2022 02:04:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWhos82aocnRvwsJ8PXmEkPm2szNXWmB/X005qefLflHUYaBqbTEmfVPE7wf+AywJM680N X-Received: by 2002:a17:90a:8409:: with SMTP id j9mr1681758pjn.101.1644401039869; Wed, 09 Feb 2022 02:03:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644401039; cv=none; d=google.com; s=arc-20160816; b=tOLOmurv6nqm1Vs9Gh6qH/2gDe9rla2il5VmzB6LowLlTC+FIynq6VmODznL6/64/5 3tIA/nKE5kRpr7mgD2Y6oRRn3hQGgpQIBnrbSnYQDqTrg69BEQSnCHckATaMSQpFLpeh 3sjgh4e7z8deHmmtHi+DYwIsAYgIIkVR5hXPIynnHWhbjUxVfkcJ+aEIXfQ/NCEEQ9Eh E08D0c4MjJyoc9WGStxOv/AcCBSU0LL7FRE978qhwwDx9/jOKIl0KTWQU4YrnL1qt8Yb 0xbKCEz6lpLADyAixebdj77STdQ7tbibIr43RkmBk/dPbFdwumw9wku0gshHxleP6ZDV s7hg== 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=VJXb/mj0nNXMCMx/LnSs0R3qDlzg/ChqCkcmOsqkZBc=; b=RuQj6k9JJX/6hoqvZzgzs6eNPGCqNq47Ox4qJZPCr0+1bFDKzPo7WGD7mYGcXLi5Ve W3jgz74pX+aGL42dpR+CiY73TXbo9tcDg+I0NMkDuPkvIzydWiaNempdbWJsDBpnPbTp KdCKTuXCXOyBw5jxEqx8eGFneSIha0TGW18Hck2YOfQSea7oXEwJFomjPDCVrZe3vuYp oTi1JXk3PH6OoSbou6siJTbaasO0F8QMPl4dNrTt5YEIIp0wOAeXQYz1KAS5hG9EN9l+ xn0M5UiW0o9mIF/4ATb0orXEDBI4sM1Mg9EoC/mn2qFT7EYV7BjU5mrYsRp0vGQg+pqW kWcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QMO9O2tS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id oa5si5291910pjb.33.2022.02.09.02.03.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:03:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QMO9O2tS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 120ACE07FD8D; Wed, 9 Feb 2022 01:13:17 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384188AbiBGLZz (ORCPT + 99 others); Mon, 7 Feb 2022 06:25:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382541AbiBGLTj (ORCPT ); Mon, 7 Feb 2022 06:19:39 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E77DAC043181; Mon, 7 Feb 2022 03:19:38 -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 A3BD4B80EC3; Mon, 7 Feb 2022 11:19:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEA96C004E1; Mon, 7 Feb 2022 11:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644232776; bh=2sGDfbpEYoz/FUbxO44JrioVvH7wDLjr+zfw4fDKx1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QMO9O2tSmbcjqUeLlOU/vm7eClpiYLK/I2RLttBdcji8TaBJJDM8nMEZcjYkPTxOm aPBX8nqT36hOK2iksgJHVt0P/jMtuznP+rMCEd4o62wMShLyuOA34FfO5CCXIxFizs vS2lhHFg5lL1pemlw5Rt9PQyXhSuwG0y0G4xpqXA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown Subject: [PATCH 5.4 04/44] ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx() Date: Mon, 7 Feb 2022 12:06:20 +0100 Message-Id: <20220207103753.305011309@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103753.155627314@linuxfoundation.org> References: <20220207103753.155627314@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 @@ -910,6 +910,8 @@ int snd_soc_put_xr_sx(struct snd_kcontro unsigned int i, regval, regmask; int err; + if (val < mc->min || val > mc->max) + return -EINVAL; if (invert) val = max - val; val &= mask;