Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2108562ioo; Mon, 23 May 2022 10:13:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqKwvVjyhc/7s8HbgTaTOuzoRwefsndD4L0p1yJCHZBAdQPMuOPoLODL/8rNeFakBgXJwe X-Received: by 2002:a17:902:e5c2:b0:161:fb68:cd28 with SMTP id u2-20020a170902e5c200b00161fb68cd28mr15148142plf.133.1653326034923; Mon, 23 May 2022 10:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326034; cv=none; d=google.com; s=arc-20160816; b=tfo1KbNZyWoI9cFDaiEOraNy5jWLDrxXXTXKni8E4Fn5tDev+5SVr6fsXUjdYl6oKX Sw4r4mMzOI8hBbBxKMML4t41Sa4hf+S5T61Gy/PmnXzbPpWlOOolEUsKUUixZrjmPP8Z F1GgLMUgxT2KjR1N9HFClagerYwF8MqfvYSlVn7tNhDTjLNhSUzEuxBFfOdzFoVBdp6E 90xnOZ9x79weNcF/7ViJh4GunqyT2Bw6xgav/KmqoXWbTMAM2VswNNBFj+3tdVsosELO C3yODiIU3RCRHHPLOC8ch+xjC4O/qK0kkCknD5Ik8IRDPxV+p0a2WgxxSBA/jc6jmCKp L0QQ== 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=zZ2B8tfxUHY3HXbCXBD12DL+nW00cPu6hWVNCu1/rhP2gLc/LZvJWjYGufhbRjEVSD 8XkrsX5v7EhRXZn8hBWAlRzZ3VJGaTxSUPBP3pNvzdxZ6OiF1ERjngcm7odHi08fKAfn bX7LKA86lNvR+2uqPgWt1HHau+jeAgcp7p9JZjaTSLpli/GlB5wGmC9RxQcJ7bJsqF0m Lvgvq/iypfZYsgmedfrpGhUSkvU1sHbaT70Trzki8qV0HAnCpM3zVJnl53XvdvOBPRlv Ljrx1eXf72SESsxjtThAHHTvhnhZy0yCEbTzi7hkGlHsjEHC8Lqfstvbp/8s7SaZglI7 Ep8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r9bBtUkc; 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 j127-20020a62c585000000b0051054f9373esi13912901pfg.165.2022.05.23.10.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:13:54 -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=r9bBtUkc; 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 C4E3F6EC55; Mon, 23 May 2022 10:13:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239823AbiEWRKf (ORCPT + 99 others); Mon, 23 May 2022 13:10:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239434AbiEWRJP (ORCPT ); Mon, 23 May 2022 13:09:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 271CD6B665; Mon, 23 May 2022 10:08:36 -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 ams.source.kernel.org (Postfix) with ESMTPS id 749A6B811FF; Mon, 23 May 2022 17:08:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD346C385A9; Mon, 23 May 2022 17:08:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325701; bh=UnaGk7lT++MCESMYYRcly019jpbFLcXmscxoXEMCt6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r9bBtUkcCAG+G7m5kDRY2x7ZHK96SRBY45cBvxnr3qg7p0w6z/8FlUvEVXF6ECrHz diqTrHOA5D+9jxAGBcPb8LiZluEHYo5CM6Ur3+xNK7t3xOgr4myfaTHKqY0oknoMeA aI6/62yeEIQds1tagsnE3a69n867sGlMsVtI2Bhc= 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.14 08/33] ALSA: wavefront: Proper check of get_user() error Date: Mon, 23 May 2022 19:04:57 +0200 Message-Id: <20220523165748.551633480@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165746.957506211@linuxfoundation.org> References: <20220523165746.957506211@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 ? */