Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2119737ioo; Mon, 23 May 2022 10:29:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzonhc8FyTioPUot5+FvrWJICMSpsuizoCi560KcQO9iaHgEm2YruopVibhH7rI/ecXO4my X-Received: by 2002:a17:902:a9c4:b0:15f:90c:12f6 with SMTP id b4-20020a170902a9c400b0015f090c12f6mr23486631plr.115.1653326949074; Mon, 23 May 2022 10:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326949; cv=none; d=google.com; s=arc-20160816; b=BfO+46fE4Ef1pM0dO7nl9Pc28YeXudu5H1PHYRoOn3BgLe+6BcrvhYwFqFyNDSIbd1 3omjpAm2lfypsRLYsCsxusZ+COzmJg6nc8oqzHm4680lmQwp0+Q0r9c3HoRrWlO/KL2c AsnPtVv+WlgfS9PGTo1D6eLTroSNRtq7LJNvoqNw+exPZgti/Du1Y7xnl1LJCwvtXgJj Hj3ArXCa2+aq5FaKz+BUZSjl5mn9QOHuIOhobL7tTYIc1OCXkgI1P85D8llHO3Qulq1L t9AE1s786BP6Q7Wqt7IoenJBeoOtZHtWrf16NnkaXmsrLnWiFQoYBDcrMuNPRzozUDYj x+Aw== 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=PTGv+tOJpib71vyoI3fZCsdXdX2gY0H6VJOWaXd44Y0=; b=JY3kLHyw7AsdFybGKHhj/w4lbQ0CLqKRGjnMoTlNcw4WI+GJW/XHf11e2NWlOZWLfh ld16E4XwzRHZVgrT+7kt+jMCwaytEwioTeLU4ynKLAcxe/YNj2kElszqS9FigZwam0fu 0QOIkvlpbrIGygelaspMvfHaYfI3uZJn2knDS76BsWl2vOKySCFygdK6N0jhbJzJrxqi Ujg7khurU3eHhk268YvuV4jRh+tYWUZQzpF+x3ThJ14Za34GzyfdFbM4Dt2HUnxXJZFd hSw8XMa9T3JfqRQEvF2kdWmSgshQuSmk0CRNoCooAj8ZVWeK+sZIv38JzEB/WtkxXAWT 50QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RLbKbH+D; 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 cu21-20020a17090afa9500b001d9e8ea9c13si13264787pjb.159.2022.05.23.10.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:29:09 -0700 (PDT) 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=RLbKbH+D; 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 BF682880E4; Mon, 23 May 2022 10:28:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240447AbiEWRYN (ORCPT + 99 others); Mon, 23 May 2022 13:24:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240914AbiEWRQs (ORCPT ); Mon, 23 May 2022 13:16:48 -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 CEE0E2495E; Mon, 23 May 2022 10:16:39 -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 B16C4B81213; Mon, 23 May 2022 17:13:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02EE0C385A9; Mon, 23 May 2022 17:13:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326024; bh=8aEDp2CsE2oABbal4zhrNg8F4IV9GGTkTm6ISpzRPp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RLbKbH+DtdCtB5GK6Z3dNhiNAqtfCsLVUOE3Dr3mvqJL/MzgArvIFCw0+s4xzuael 3ErI65w9kgrdHvoyAE9q+X8ItuUr4lwCgUeY9ktvF0qPKYsD+99OtQipYRzWQ844zm jiSKRbNxJbOparUY0/NYQMU6Ez7SSHLIvtaZORho= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds , Takashi Iwai Subject: [PATCH 5.4 26/68] ALSA: wavefront: Proper check of get_user() error Date: Mon, 23 May 2022 19:04:53 +0200 Message-Id: <20220523165806.949229632@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165802.500642349@linuxfoundation.org> References: <20220523165802.500642349@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 @@ -1088,7 +1088,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 ? */