Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1208140rwi; Fri, 14 Oct 2022 14:48:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68GOI5TQZXiiJEynCx7CbKCYjgfhBE4HUym6iuQSCkGWziwY+ssETdvSQZfEKeEuZpG84C X-Received: by 2002:a05:6402:ca6:b0:458:60af:6875 with SMTP id cn6-20020a0564020ca600b0045860af6875mr5774870edb.295.1665784096310; Fri, 14 Oct 2022 14:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665784096; cv=none; d=google.com; s=arc-20160816; b=an5bUUWRqCZAsm6M7IycugL4oqEzI6tK2lob5yLINIHovmW3dFdbdkVD5urEWIovug Yfwzbm70vUWLM8owa+BLuoR/Qn8GXRa2WLANRH/7xF1YwAXk2d/3B31s4v/bKCNN9qQ5 xpxvevdhloThSQT31g6md9zFTWB0zVlaBa5qEjDCLV3uGGDiGkEBFVdraCW2w49+3x9x RzW0IjKCNofOZWPm/0OWK2NUoc4TKL12HUWK5PtVgRIE33jflCSWnKLNjV0HbpsonOTW z5E4n1xAhfyN8XtBT2CObw6R9SEcK7Vr+wWGXaX5YmSHEqEIpxzif9ysX7PljdjzNwq5 mHmQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WafvIbqYWEjqgBfGrGB+As4ybITkBSPHp+DkLf93LN4=; b=hqhszdAZg0UymgOtQ4RT2KdgeknjBy9hE2Hs5OqkouOTrAhVrBMIkIzN0Yi3Ij97VZ Pm+X3o2lAy67YHdQxlbCZpLYxxtRbeuSRIESwjLnVsQg72jibDeS0XQsWdVuXe3KVF1n AHJVUVtMeJmfc3fjeBD1RxlgtYL1+lTeYGLnF3dO6cmf3lHszn+zj3+tJS+GBB3Vo/PK mL2RVyq97bh2KqAS8+64ttrJviETInkp6/0D83zx8un7VJyEfeHazY+vJGT7fOpYo5iH GaVshPI0/n3AZ6ZKJDlntRz2WNjSeSdtINYBkRbI3Q1Hv87Yd5qjMKxNVwggB2qELceG fjUQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a50c2c9000000b0045cdea002e4si2922710edf.66.2022.10.14.14.47.50; Fri, 14 Oct 2022 14:48:16 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbiJNVXQ (ORCPT + 99 others); Fri, 14 Oct 2022 17:23:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229916AbiJNVXI (ORCPT ); Fri, 14 Oct 2022 17:23:08 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 848AE1DD893 for ; Fri, 14 Oct 2022 14:23:03 -0700 (PDT) Received: from localhost.localdomain (178.176.75.138) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.14; Sat, 15 Oct 2022 00:22:57 +0300 From: Sergey Shtylyov To: Oleg Nesterov , Catalin Marinas , Will Deacon , , CC: Andrew Morton , , Subject: [PATCH 03/13] arm64: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:25 +0300 Message-ID: <20221014212235.10770-4-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20221014212235.10770-1-s.shtylyov@omp.ru> References: <20221014212235.10770-1-s.shtylyov@omp.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [178.176.75.138] X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 10/14/2022 21:00:39 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 173137 [Oct 14 2022] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 500 500 6cc86d8f5638d79810308830d98d6b6279998c49 X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.75.138 in (user) dbl.spamhaus.org} X-KSE-AntiSpam-Info: omp.ru:7.1.1;127.0.0.199:7.1.2;178.176.75.138:7.7.3;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: {rdns complete} X-KSE-AntiSpam-Info: {fromrtbl complete} X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.75.138 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=none header.from=omp.ru;spf=none smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 10/14/2022 21:03:00 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 10/14/2022 3:23:00 PM X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov --- arch/arm64/kernel/ptrace.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index c2fb5755bbec..f3af3371280a 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -514,9 +514,7 @@ static int hw_break_set(struct task_struct *target, /* Resource info and pad */ offset = offsetof(struct user_hwdebug_state, dbg_regs); - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset); - if (ret) - return ret; + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset); /* (address, ctrl) registers */ limit = regset->n * regset->size; @@ -543,11 +541,8 @@ static int hw_break_set(struct task_struct *target, return ret; offset += PTRACE_HBP_CTRL_SZ; - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - offset, - offset + PTRACE_HBP_PAD_SZ); - if (ret) - return ret; + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + offset, offset + PTRACE_HBP_PAD_SZ); offset += PTRACE_HBP_PAD_SZ; idx++; } @@ -954,10 +949,7 @@ static int sve_set_common(struct task_struct *target, start = end; end = SVE_PT_SVE_FPSR_OFFSET(vq); - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - start, end); - if (ret) - goto out; + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, start, end); /* * Copy fpsr, and fpcr which must follow contiguously in -- 2.26.3