Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1563629rwr; Wed, 26 Apr 2023 17:45:55 -0700 (PDT) X-Google-Smtp-Source: AKy350ZkdyQWsmWQo3xu4aBifH77YPfz6qALpv2t/XG8eEvMGuKoLMCE1rLkNzxSM7WUMhfRVak4 X-Received: by 2002:a05:6a20:1592:b0:f4:3935:4470 with SMTP id h18-20020a056a20159200b000f439354470mr16536438pzj.8.1682556355043; Wed, 26 Apr 2023 17:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682556355; cv=none; d=google.com; s=arc-20160816; b=r4wFKEoXD1qS88mCyWZpEhBeUN3sknXp8ccy+Ik876/Rnn0TnMBBJYMky+y0G7Lo1R x2JkPKTbQ2bhXvYuxB0NvwLYQu8EcQBN1NmF9uGanRhd59WXwR96yAeABGrS1tIvwiP7 6BhP9lEt4IBU+9o7sJkkvQHltjtzjbmOJCMCJuI2K5OMgUCuDBDPH42tOP+gCgPHjR38 +vtAytx2QxiZBWH7/s8dBQb9OqRUyIk3D/uooQbuM7xdee1Kq1uRBTXWso+kn1jHGwx3 brBjaur2VVb7fkJ3D+3+ll0TgjuPQ15uy3GG5nddBV/St9RcxDQh2eL4OoRzvJXLx5te Bbag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:authenticated-by; bh=ftLyvOofInQua2/bDb8DrGPMU4jkzuolb7EqQKlXOJQ=; b=Nv8U9SD4KraCX1uQ3pHtb1oftsbZnuSa8JrG99JmK716f82VP6vDKDlmhlXQAyYtB2 QhK6nmdQtQa1m/3DHDem2DxMwEeMbpPmIpvIplVWZPrFqMZ9Grd3UDyDY/zSOvHQhcGH guJ+q/RkG5ID2h/H1KkT4mY6R9w+/3E3Ydocx7QumkJUtC5K3Q6W3kozL508IWxk4V/3 q4inxJCvM6HLUUeVXiiRsbbjQ+dV8T/dXBIJ918Bz4nx7vp4h64xFvMkYw9PFfIcNGyP dds1nyT0ahj0FHoC1OlrD/DI+GJHC0kOEs75+tdqxANKPxHFD8FCoC8Qa8/Dh+pmwRTQ TEaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a6552cb000000b005137bf7e2d3si17737339pgp.582.2023.04.26.17.45.45; Wed, 26 Apr 2023 17:45:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242878AbjD0AoW convert rfc822-to-8bit (ORCPT + 62 others); Wed, 26 Apr 2023 20:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242875AbjD0AoV (ORCPT ); Wed, 26 Apr 2023 20:44:21 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96E70420C; Wed, 26 Apr 2023 17:44:08 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 33R0hgtT7032368, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 33R0hgtT7032368 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Thu, 27 Apr 2023 08:43:42 +0800 Received: from RTEXMBS01.realtek.com.tw (172.21.6.94) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Thu, 27 Apr 2023 08:43:44 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS01.realtek.com.tw (172.21.6.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Thu, 27 Apr 2023 08:43:44 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d]) by RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d%5]) with mapi id 15.01.2375.007; Thu, 27 Apr 2023 08:43:44 +0800 From: Ping-Ke Shih To: Zhang Shurong CC: "tony0620emma@gmail.com" , "kvalo@kernel.org" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v3 1/2] wifi: rtw88: fix incorrect error codes in rtw_debugfs_copy_from_user Thread-Topic: [PATCH v3 1/2] wifi: rtw88: fix incorrect error codes in rtw_debugfs_copy_from_user Thread-Index: AQHZeGDriu2WwT6tIU69frHwp0rSPK8+Uc0w Date: Thu, 27 Apr 2023 00:43:44 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US, zh-TW Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.69.188] x-kse-serverinfo: RTEXMBS01.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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-wireless@vger.kernel.org > -----Original Message----- > From: Zhang Shurong > Sent: Thursday, April 27, 2023 1:02 AM > To: Ping-Ke Shih > Cc: tony0620emma@gmail.com; kvalo@kernel.org; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; > pabeni@redhat.com; linux-wireless@vger.kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; > Zhang Shurong > Subject: [PATCH v3 1/2] wifi: rtw88: fix incorrect error codes in rtw_debugfs_copy_from_user > > If there is a failure during copy_from_user or user-provided data > buffer is invalid, rtw_debugfs_copy_from_user should return negative > error code instead of a positive value count. > > Fix this bug by returning correct error code. Moreover, the check > of buffer against null is removed since it will be handled by > copy_from_user. > > Signed-off-by: Zhang Shurong Reviewed-by: Ping-Ke Shih [...]