Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1174858rwi; Fri, 14 Oct 2022 14:10:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6drhYW571cPSBn7Dr4918sjnWmi9ivM7yya2/x3hI6mmjTSP3QW5Lj+ZXqmyv7xJ0HwBon X-Received: by 2002:a63:1c47:0:b0:44c:2476:12ff with SMTP id c7-20020a631c47000000b0044c247612ffmr6429393pgm.50.1665781815372; Fri, 14 Oct 2022 14:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665781815; cv=none; d=google.com; s=arc-20160816; b=JeqCBA6yi29xnZwSRxiFSAEzI6kzBzTBRuIeMJS9HZ32tG2XEBjhrfaqMpigTnGzHq AzQi3OJndqoTb2kAF99DSE3GCs4FffF7mslp9+22eb/a/0PPj9nXLV3SFUdjzvrLNmtr r+R/zQ7yu2LM+e3nZGl8jIHu89ELG6LFwu6nS9TBL8QCZo22S4SnEhxUA7vLyFF+Uo5R jXc8gyC2j6uUffXdevxRDdVNs1KsLkCC32CipVo6pOcPOG8XPMz2xR2v6nnMYK3UeGv+ pQmPOHSEtF+ZsVhtn/LjEyjCEm6iohSXupduk6qUnxc8i0Eq/sz7e/990Phf41vVEybl RvfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=V6F4cqScoAnyG62i61m4oJ0MGIQvNAp6Biva4swYu9g=; b=rxfo+xp3z7cWKse/QU8ZWhqbGZY/ZC1OkzBh1HmFiB29wuIOIj8SW/7Cjw0YYcwiPt xd6XMQ/eXDwJantR7XD4+fMGpmSowIj1ZL+ZN2BNRsJg57EoR91gB0FxCSBq8B/q7vd3 WxkcWKJbKtZNguVd5rOZ8xKcmsIsMbZA1v2subkYky80lWGKnOW1gTztiZjwwCy6mbsQ IlMR3OYWznTcXy8EGOnzOEGBPfw9jaj84sAHxVmcJQdCx7oGtSwaVLUDrN7FWCkEBrj1 M4mv/OvVbnKjFXl8AxUuacPJP0TORL29jO4BOp2tKL/INDRWjvQQjhfgS0OIaxNNIfq3 FnEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020a63204f000000b0043ca1b4984fsi3860033pgm.865.2022.10.14.14.10.02; Fri, 14 Oct 2022 14:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231578AbiJNUpw (ORCPT + 99 others); Fri, 14 Oct 2022 16:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230392AbiJNUpt (ORCPT ); Fri, 14 Oct 2022 16:45:49 -0400 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AC09D03AB; Fri, 14 Oct 2022 13:45:46 -0700 (PDT) Received: by mail-pf1-f175.google.com with SMTP id y1so5964540pfr.3; Fri, 14 Oct 2022 13:45:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=V6F4cqScoAnyG62i61m4oJ0MGIQvNAp6Biva4swYu9g=; b=CPR1GPSR9p8XPYplL4jnpZDVA8mVxl/7kICuPJ/Z5OC6ZVbDvEMGd9xs/YuWwFptwu 7SIT4YEuWo5Ev4UQYhXcag2E2jThUwZKhU+MouhdFsMFGM+UATnTXTxRp/wCkv4jY0uD zGCjQu/qid5KfRdVN4BRefUsoLsosP+k3bpyIj56s481GMGQctYSlw3zGN9XScAUu4Al bv+wzxPF6ywWk06xOrkDs6Z4I0uR5e8zMELDWAyyE/+PFTeC85UzK4uBjVzKCALv4qj6 a8N4Tzb0JdpNH4wYNtKcgLNbGhF6sItGMkxWX/830nDEbmo6htJBe/X5ZU9QTvQ4X+yS 7DiA== X-Gm-Message-State: ACrzQf2wUD/QG79wsst+Dp6/caD4XWYv4EL6OvT4nmrkLTDfgSJe1xAJ 5FjP7/MsEYDWJe1UtQ9++kg= X-Received: by 2002:a63:1353:0:b0:457:3e87:7883 with SMTP id 19-20020a631353000000b004573e877883mr6039567pgt.172.1665780345440; Fri, 14 Oct 2022 13:45:45 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:7bd3:5500:b9cd:d90d? ([2620:15c:211:201:7bd3:5500:b9cd:d90d]) by smtp.gmail.com with ESMTPSA id c12-20020a170902d48c00b0017a032d7ae4sm2147835plg.104.2022.10.14.13.45.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Oct 2022 13:45:44 -0700 (PDT) Message-ID: <16bee8e7-a9ec-0847-9d89-92484b0399a0@acm.org> Date: Fri, 14 Oct 2022 13:45:41 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v2 1/2] scsi: ufs: core: Remove unnecessary if statement Content-Language: en-US To: Bean Huo , alim.akhtar@samsung.com, avri.altman@wdc.com, asutoshd@codeaurora.org, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, beanhuo@micron.com, tomas.winkler@intel.com, cang@codeaurora.org, daejun7.park@samsung.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221010092937.520013-1-beanhuo@iokpp.de> <20221010092937.520013-2-beanhuo@iokpp.de> <227f117ee9491cc9d2ae4bb2211a99ccd1dd3c21.camel@gmail.com> From: Bart Van Assche In-Reply-To: <227f117ee9491cc9d2ae4bb2211a99ccd1dd3c21.camel@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS 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-kernel@vger.kernel.org On 10/14/22 13:30, Bean Huo wrote: > I double-checked the changelog and the stack overflow issue was double > fixed by your commit: > > commit d3d9c4570285 ("scsi: ufs: Fix memory corruption by > ufshcd_read_desc_param()"), > > For example, if the user wants to read wb_buf_alloc_units in the RPMB > unit descriptor, > > parameter offset = 41, parameter size = 4, > buff_len = 45; > > After ufshcd_query_descriptor_retry(), buff_len will be updated to 35. > > param_offset > buff_len, then -EINVAL will be returned. > > So we can safely remove this check, and if you still have concerns, I > can verify when I get back to the office. Hi Bean, Thank you for having looked this up. I agree with the above. Bart.