Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2109650ioo; Mon, 23 May 2022 10:15:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyknZJ8X28zqavSucCvRJNl341OsiGGksVGPpfZQouNaho0CX0tKLShiMCtqzWit6ykuLbX X-Received: by 2002:aa7:8390:0:b0:518:3f2d:1e2 with SMTP id u16-20020aa78390000000b005183f2d01e2mr23314283pfm.36.1653326104392; Mon, 23 May 2022 10:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326104; cv=none; d=google.com; s=arc-20160816; b=X0eK2+yk45pNpWyZcUj9E7+fo0OJRTV7yD3t+UWLhbHLVfvlFncfmzq+5DR3rtDOjC B6ewcIIuPCDh6+vWEzS8tyKX/tUlcrv7ovyYuRuUF3n4iLq8lmxdY41Yhu9tj9OcpfIb xIZQgGLrl67L/uS1/J4ryLXKo7HCoNl2CKi18UNnW3GEG6NbyNMWwWDWGuUtls5eKAcB 3mmR8zpc0Vt/j9p0yeKKUu6BYu6RamYbMD8RlgXJi+8y5W0kTrh58+BsBdD2aEhkOE7d JsXokFK8bmU4fC1PNFCWUSI043jvZZCqbBJMF0KrUbQe40vqMk8wIh9pIZjY6q98cquL kbrg== 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=3x/XiuXhjXwOuTA2yPGjtTzQlunzmataX/GrePTxc0A=; b=zdR0XPZGIkllPFSqUfoBo9u83yWsSD8PgKVYAeHQnjplgK2W9mL6blBJ39Yp7llK3v qAAGJ9DbxmrTQ42gTDgLn8roUxqMTzuXB1QQKXv7TdRkUVfVmfFHdKwwqA/ZplDA1GEH cwq2YBBBkzBzjxqhLklfksf2eU2qjHm0aEhZQ/IS3WiFTJTN1pQy2lJxdxH2mJq3luvF s+Z3yy0TVhMQfZ01KLb50u0zsGfzGwl03Tv6v6fYt0Ankrrxml0dQ/SLVZTmTxNGPTnr FycYk7Xu6ujCcvmN2lEgUd8qGZUVJ7yb9g84ziMJqoLD0oLZ2qxCRyt7U3UvugUy3maP 4WVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mPsQLgqy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id o16-20020a17090ad25000b001e06a33e061si466950pjw.63.2022.05.23.10.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:15:04 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mPsQLgqy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 374F76BFF6; Mon, 23 May 2022 10:14:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239513AbiEWRNh (ORCPT + 99 others); Mon, 23 May 2022 13:13:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240068AbiEWRLh (ORCPT ); Mon, 23 May 2022 13:11:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2E0DE0FD; Mon, 23 May 2022 10:11:01 -0700 (PDT) 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 68B60614FE; Mon, 23 May 2022 17:11:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6043CC385A9; Mon, 23 May 2022 17:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325860; bh=UnaGk7lT++MCESMYYRcly019jpbFLcXmscxoXEMCt6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mPsQLgqyVPw3tcE44GTP+szSXGe7hmCAiY4KyUsIwcvN3ynANHfAb36YEgK08WQ/j 8/E9R+NitrL/J+vt2gqosZw3dILGnIH/1VxClOHYMaupQGUm27F18kvda9N15XzCrg MonTEV0++PYoBN3oqty+en22xLp9rMJ2zx4y434E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds , Takashi Iwai Subject: [PATCH 4.19 11/44] ALSA: wavefront: Proper check of get_user() error Date: Mon, 23 May 2022 19:04:55 +0200 Message-Id: <20220523165755.384333184@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@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.6 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=unavailable 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: Takashi Iwai commit a34ae6c0660d3b96b0055f68ef74dc9478852245 upstream. The antient ISA wavefront driver reads its sample patch data (uploaded over an ioctl) via __get_user() with no good reason; likely just for some performance optimizations in the past. Let's change this to the standard get_user() and the error check for handling the fault case properly. Reported-by: Linus Torvalds Cc: Link: https://lore.kernel.org/r/20220510103626.16635-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/isa/wavefront/wavefront_synth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/sound/isa/wavefront/wavefront_synth.c +++ b/sound/isa/wavefront/wavefront_synth.c @@ -1092,7 +1092,8 @@ wavefront_send_sample (snd_wavefront_t * if (dataptr < data_end) { - __get_user (sample_short, dataptr); + if (get_user(sample_short, dataptr)) + return -EFAULT; dataptr += skip; if (data_is_unsigned) { /* GUS ? */