From patchwork Fri Oct 14 21:22:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp383154wrs; Fri, 14 Oct 2022 14:26:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7YhnxjrDeGf8lFQXLFfFvaDMz1kHNf8O2FoogjYVO44wClVwrswbOkreE/TlJ7sJjEbBHu X-Received: by 2002:a05:6402:1d4e:b0:45d:27e4:f93a with SMTP id dz14-20020a0564021d4e00b0045d27e4f93amr3668650edb.287.1665782802872; Fri, 14 Oct 2022 14:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782802; cv=none; d=google.com; s=arc-20160816; b=QuCKMQ4MKdVJq+ZENqIWpEo28WQ9EKqvIp3mDWHAdkh4t571Tb8nfTv8xHfc3DaQFv eqV0Z1fx/igHN7nfgF506rJ1K6FRtzkFhqiZFrZQXE9P9DUJAhMucaNEOqmcUFZFwfnN pYd/11kl2bRkYMaNjxjLgF4aIl6T/7yiUhF31W1DD9DN1KViJ0K4QzdSFCQoYrF2PWVQ izmiCXdGEu8eo+SkI5t4MlYhIZlsutDdm0IAH2RB7uR18KyC8Ozk4K6UE0zn0WgaeBSm z0Z3apZOkM7NuMFOn09zrj63M2/FKDT/6kz4GXiWrp73bywSB1drV3OZ7i5ZU8XcJDjr NhqA== 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=E03+78ee/OgvwNFXxRR5AFGA5rd1CIzLukkYilHlHrk=; b=YU4AfPkBgrPm4LOZdKcQwa57cWgDCnuO3zi3g0ld8mM7JIbIfgNF8BPahLgEvYY9Qo ce32A5FSCfskSy3sTP0tar1zZoGbZ6XgHRW1fYpdcf2y4ocXs67Nt0CQNW07162gj558 3y3MBynDs/v+gmchEqcH+WAU7KPAvOj0sF1Xby63/Kca/y9s+itjqqwHgYPRtq0YNeou uDjOvuIHkOOVwcLx/e83PZUFaKehOMEq3bFzam8nWau7iOd39nP8zY1uAX6ZBb/EXyBI 8ynszdiyvcBv3qgwd70wvsYiOL2zapND7dfC57T/5+lQ6Ex7N3/azzo3aiXaCLHVoJ3p VtwQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz41-20020a1709077da900b00782a33f2850si3297923ejc.736.2022.10.14.14.26.18; Fri, 14 Oct 2022 14:26:42 -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 S229897AbiJNVXH (ORCPT + 99 others); Fri, 14 Oct 2022 17:23:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbiJNVXA (ORCPT ); Fri, 14 Oct 2022 17:23:00 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDD711DC09C for ; Fri, 14 Oct 2022 14:22:55 -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:47 +0300 From: Sergey Shtylyov To: Oleg Nesterov , Vineet Gupta , , CC: Andrew Morton Subject: [PATCH 01/13] arc: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:23 +0300 Message-ID: <20221014212235.10770-2-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 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: omp.ru:7.1.1;127.0.0.199:7.1.2;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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746699868329792755?= X-GMAIL-MSGID: =?utf-8?q?1746699868329792755?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/arc/kernel/ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arc/kernel/ptrace.c b/arch/arc/kernel/ptrace.c index da7542cea0d8..2abdcd9b09e8 100644 --- a/arch/arc/kernel/ptrace.c +++ b/arch/arc/kernel/ptrace.c @@ -185,7 +185,7 @@ static int genregs_set(struct task_struct *target, #define REG_IGNORE_ONE(LOC) \ if (!ret) \ - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \ + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \ offsetof(struct user_regs_struct, LOC), \ offsetof(struct user_regs_struct, LOC) + 4); From patchwork Fri Oct 14 21:22:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2843 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp383168wrs; Fri, 14 Oct 2022 14:26:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM756ma04++0n63O1nwca2n+XhelCgrqqjh9+OKy0kyhb+ErnmcHiGbV+RzWZka0ELFVuky5 X-Received: by 2002:a17:906:cc52:b0:78d:d477:5b7f with SMTP id mm18-20020a170906cc5200b0078dd4775b7fmr4904351ejb.558.1665782804873; Fri, 14 Oct 2022 14:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782804; cv=none; d=google.com; s=arc-20160816; b=JDKjoVTOiSRMn7s/QNDtavhGoiqTPy/kWREVbXjkZGQtSHHS/zVt2IuRfFrEjU8qHJ txCPRymXt/BqoFJZH8rjAKYFy7aX4TpdZBs/5mBE2vQI5jN/3aytELpduyynCeByaUEz QSh086BfBc/HjfHNNXYJ5jKCWhLnU720qs6IE8XdO/z9CZxTMILUnXckRxrbXhGGPFTf bdFAirxonKYhXPs006jYh0uajM/Kfftw7wJmAKk9amaYBvv4yaQ1n6ZFvPZrOw0NXVMC Bo7Ckynw2wQ/rf3L5JYOiONMHdvd7Workmz2U2R2q4fPKOkxodK3LfFSlL3rUIERA5Or tOZg== 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=D2t7VPy1r8eDVCeHp8jGAi02dt02jGuELWwMgKHRsqA=; b=f75ryphnnUJsE0WCv6H6JAMh27PqNvb170dV9mC8FQPHueYvFoSRrvq74RpVNwgrYi i42gqH+f+RFwoSKnPZsqEVEkjvDcyL9hZZpTEbjBdJ/vKe5ySOTdlF0F2vS0ARIMI5a5 zkMEfzd1eIhOP8Li1lgCVojNd8U0Tlj2PTdcNtQr1SKcERopeKrTL8ROC0RlcKatza/T TavUTD2coN2sJH64qiRNfIVFkyojoNpcCtcjbcLGw/Sai8RRpeAYcqXmqFdttqklweny 4XYRO0ZUKCYramEa+0Q0JolK7jY1I9hE7DyUrNHVh3VYtLXUkgIYB9ZjdFQe7W2vSSno xLyw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he38-20020a1709073da600b0073d6b849d4fsi3229656ejc.731.2022.10.14.14.26.19; Fri, 14 Oct 2022 14:26:44 -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 S229924AbiJNVXL (ORCPT + 99 others); Fri, 14 Oct 2022 17:23:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbiJNVXD (ORCPT ); Fri, 14 Oct 2022 17:23:03 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3698E1D3A77 for ; Fri, 14 Oct 2022 14:23:00 -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:51 +0300 From: Sergey Shtylyov To: Oleg Nesterov , Russell King , , CC: Andrew Morton Subject: [PATCH 02/13] arm: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:24 +0300 Message-ID: <20221014212235.10770-3-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 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: 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=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746699870202479020?= X-GMAIL-MSGID: =?utf-8?q?1746699870202479020?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/arm/kernel/ptrace.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index bfe88c6e60d5..2d8e2516906b 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -651,11 +651,9 @@ static int vfp_set(struct task_struct *target, if (ret) return ret; - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - user_fpregs_offset + sizeof(new_vfp.fpregs), - user_fpscr_offset); - if (ret) - return ret; + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + user_fpregs_offset + sizeof(new_vfp.fpregs), + user_fpscr_offset); ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &new_vfp.fpscr, From patchwork Fri Oct 14 21:22:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2844 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp383191wrs; Fri, 14 Oct 2022 14:26:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YCM3EClMkjm7h3gVLeLAoZhz4rNUWbrvIM/Y/u1QjIV4e0iG0ZANbsDpEi0pT9jfbhBoX X-Received: by 2002:a17:906:58c6:b0:78d:b37f:5ce5 with SMTP id e6-20020a17090658c600b0078db37f5ce5mr4960565ejs.707.1665782811614; Fri, 14 Oct 2022 14:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782811; cv=none; d=google.com; s=arc-20160816; b=vvce4MhhSnX6BWCJGFZI3SBUWuIE4cnWgbVyZ7cpf0JavHBY9MdjZN0xitkeVYIUhT kvQot0+3VVbqAXvjft85GQfhawHxO55hiicEDwlFcIEr4KKH1/f5okhTJYyW6oFgz8lX VV1Bm3NDSx6JbUM+6xH5enk+tP7f48PEZ7PoElW63PqKwKHvWLVmhMKkkDzKkCmkfakk 4DXK52o20ReC/3kjOE8baF8BWMHM09vu4/cvc2T7ZiB1UtrHVxYf/55ulX4SKN79jepJ H5JNLlAQIM2XDpwiTvgIAGX2ZxqgsJnrY1zXOmXaJLCyJ/Q/cAopni0B+en3HFrFQFQL F/vA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ae8-20020a17090725c800b0078db794016csi2996803ejc.907.2022.10.14.14.26.26; Fri, 14 Oct 2022 14:26:51 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746699877197066992?= X-GMAIL-MSGID: =?utf-8?q?1746699877197066992?= 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 Acked-by: Catalin Marinas --- 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 From patchwork Fri Oct 14 21:22:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp383705wrs; Fri, 14 Oct 2022 14:28:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4uxMDHb4zpPbBNK1bmT3MscImjLr0o8ljxuNM6t9OjdyHQ9aoTn3GUamGwylCob2ALrTTt X-Received: by 2002:a17:906:fd8d:b0:780:997:8b7b with SMTP id xa13-20020a170906fd8d00b0078009978b7bmr4989297ejb.635.1665782914930; Fri, 14 Oct 2022 14:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782914; cv=none; d=google.com; s=arc-20160816; b=sx3+E94OBVwxhID+aN6ix2K+iOIWGj1M7AAHWKAzMTo1vohOFmdqvQpJmrMi76bcAC Y3hM8aCMoNrM5do4svu8vGMu2nmt0b11rhvoRcX1XgQVPWAzNfTxSrQaeMXu/6BY16u4 P5m/sPxV8UwnMeoiyV7JD3jh0nD5cHZCYswIyaCoHLtXzodiMddinEpDfunXpBsD0xuj avw2I8P4EdDoENAQFLmrE82iopBLmmD9rJkZQLmz9Ml9R8/qojJqU4sP8/L+//Y+v7mT 8HQ6dL+j0jTy+0m5zXIoKXeYWE0hQp1I2JToB50t2HO75xtOmmjD056hCA85pCXkYZOW Q1Nw== 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=RqHljShji1WP4HOq+pEnVxdUm1/gKAOSP+LPcQ9+/QE=; b=dvWLXC79gCfa5CGWwqi90b7wocrPcfJW4oJeHwtLZISZOGPq5XEnyMhj+HCepgKjFq XtQtLkOCQw0Kb1ZxA3HJw3kV5ZGx7EoDkJgpaLl3zTzWzk92O5xHZF8CgSrTxgPe3Yyb F9H8s+YmPG/UvO/HNz3uHA3cKTojCFyZDUlHYyTy1pD+yArSNlk+SBo23rNdHvvPmFJ0 VDiDb+K12IY4dOVsQeUo7Z+rNcNXmPLjbGGeRN7mqP+NakpHKRCZqU93ECUdxotUTQcb ZQ6g95kEYO3SnUa/j5m5PfTSbvW4NUB8NuW8O5ql2pjqChuOdXqpIQbAz7dUzLia0o5v D/cg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho35-20020a1709070ea300b0078dcbc9a9b1si3629602ejc.737.2022.10.14.14.28.09; Fri, 14 Oct 2022 14:28:34 -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 S229708AbiJNVX0 (ORCPT + 99 others); Fri, 14 Oct 2022 17:23:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiJNVXQ (ORCPT ); Fri, 14 Oct 2022 17:23:16 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A06C1DD8A1; Fri, 14 Oct 2022 14:23:09 -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:23:01 +0300 From: Sergey Shtylyov To: Oleg Nesterov , Brian Cain , , CC: Andrew Morton Subject: [PATCH 04/13] hexagon: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:26 +0300 Message-ID: <20221014212235.10770-5-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 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;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 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=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746699985786903451?= X-GMAIL-MSGID: =?utf-8?q?1746699985786903451?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/hexagon/kernel/ptrace.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/hexagon/kernel/ptrace.c b/arch/hexagon/kernel/ptrace.c index 8975f9b4cedf..125f19995b76 100644 --- a/arch/hexagon/kernel/ptrace.c +++ b/arch/hexagon/kernel/ptrace.c @@ -115,10 +115,9 @@ static int genregs_set(struct task_struct *target, /* Ignore the rest, if needed */ if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - offsetof(struct user_regs_struct, pad1), -1); - - if (ret) + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + offsetof(struct user_regs_struct, pad1), -1); + else return ret; /* From patchwork Fri Oct 14 21:22:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp383276wrs; Fri, 14 Oct 2022 14:27:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/Dq4CqjbeVv3KGbijhAHDhJGXz/H4/PobrzEuVzQJLPosTGz1AZjiiUjYlPqllAto4m29 X-Received: by 2002:a17:906:6a04:b0:78d:ee09:d956 with SMTP id qw4-20020a1709066a0400b0078dee09d956mr4913646ejc.698.1665782830510; Fri, 14 Oct 2022 14:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782830; cv=none; d=google.com; s=arc-20160816; b=Wy1mNbX1lOKO9Ti2ZWTePU0lDivnFpApPlo9UScpGYdloVkKMZmmg7HcLxPBemD7dl 3t08Trg4zkWQ9wSq7iK0WdZqog3gCkCkd9FOVkFWpZ7irYAz5eslNWwjdkYGM2iwFh65 l+06xyrOZswmFn9gN41wfdPwQttD7TtC4vk7+GHXvc9dp3RtutZ98ttoR5ZEZdGJ1Ov0 s6D0HrPznedAdalCPjEt/gGTQA/gMGzv4lwIzDr1Fd2sy/Gv6FOv3IJA+cN8oCz+7r+5 hbJlVj1b9yOQbJm7R31yzNGKZN4wQvUMFOpC5xBfHnPR5z+rRlaLzqFqCiuYHYDQcszJ Xx+g== 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=M99DYhLlbqPioEcxkvEaiL4LX6zpIncDJTaKfC5trWU=; b=E9UACITj4bJ9MQcTXNMvV1esU6TAveSdYOl4De6XNbrG2oKgccZ27XYxML3l0reB+Q PINgdDJxAEJVgdnYgEgpmtdWFLcIa0F5civhHNLADaoJTt5Z/CPUqCvk79vhsyQZrvA/ nLkD1eW/hwm3W0M2Bhp7XZFJiNE5N/tLVvlD+mV6Vs26Zo/UFeUdF12GFDBqKqd+cr4f acI9Z6Yj56wJDeF18e+BzL04+NPCKUkVlNowC7vnG/+DDENuE9bc613tU0FL1rzz3zcX ADMC3J2rH9ongeCvAYEnI5UZd9My4DJ8/KPYZ1iMhEKxe/W1A8irQioDjugwws8/Rs4S Ey5w== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd27-20020a170906c83b00b00783160b16a1si2570847ejb.397.2022.10.14.14.26.45; Fri, 14 Oct 2022 14:27:10 -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 S230000AbiJNVXf (ORCPT + 99 others); Fri, 14 Oct 2022 17:23:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbiJNVXZ (ORCPT ); Fri, 14 Oct 2022 17:23:25 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCDBA1DD891; Fri, 14 Oct 2022 14:23:15 -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:23:06 +0300 From: Sergey Shtylyov To: Oleg Nesterov , , CC: Andrew Morton Subject: [PATCH 05/13] ia64: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:27 +0300 Message-ID: <20221014212235.10770-6-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 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: 0 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: omp.ru:7.1.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.75.138 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746699897180940859?= X-GMAIL-MSGID: =?utf-8?q?1746699897180940859?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/ia64/kernel/ptrace.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index ab8aeb34d1d9..4c41912c550f 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c @@ -1481,12 +1481,10 @@ static void do_gpregs_set(struct unw_frame_info *info, void *arg) return; /* Skip r0 */ if (dst->pos < ELF_GR_OFFSET(1)) { - dst->ret = user_regset_copyin_ignore(&dst->pos, &dst->count, - &dst->u.set.kbuf, - &dst->u.set.ubuf, - 0, ELF_GR_OFFSET(1)); - if (dst->ret) - return; + user_regset_copyin_ignore(&dst->pos, &dst->count, + &dst->u.set.kbuf, &dst->u.set.ubuf, + 0, ELF_GR_OFFSET(1)); + dst->ret = 0; } while (dst->count && dst->pos < ELF_AR_END_OFFSET) { @@ -1560,11 +1558,11 @@ static void do_fpregs_set(struct unw_frame_info *info, void *arg) /* Skip pos 0 and 1 */ if (dst->count > 0 && dst->pos < ELF_FP_OFFSET(2)) { - dst->ret = user_regset_copyin_ignore(&dst->pos, &dst->count, - &dst->u.set.kbuf, - &dst->u.set.ubuf, - 0, ELF_FP_OFFSET(2)); - if (dst->count == 0 || dst->ret) + user_regset_copyin_ignore(&dst->pos, &dst->count, + &dst->u.set.kbuf, &dst->u.set.ubuf, + 0, ELF_FP_OFFSET(2)); + dst->ret = 0; + if (dst->count == 0) return; } From patchwork Fri Oct 14 21:22:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2846 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp383434wrs; Fri, 14 Oct 2022 14:27:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM43L39mWxWT1ikA4koojIucOuA07YOlHuvgpRVPtp+vzg1ZfLQPxdmz86WvXhrdppiC1qiU X-Received: by 2002:a17:907:802:b0:781:8017:b2df with SMTP id wv2-20020a170907080200b007818017b2dfmr4933576ejb.606.1665782862491; Fri, 14 Oct 2022 14:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782862; cv=none; d=google.com; s=arc-20160816; b=eL5p/YtLyf+LyeAjBH+i/vkuTdvBvC6Zud5L4lFK9x8irAgAuDyzERi+qx60HyOpoo 4GeEHntUMiqMlX99pXD1NejrOwDEF2n8AvuRJYyx8/PRpzwK9RO96INO84y0PDeQ6vQ6 kn195DGeSXpfm1dc6AwB0mApT2XmYz1fP0x7rY3xnSTyqxsc0uuym8/4F46oBkuwqXxF ykc0V2ifaxkLkv+3bh3bKNcp0dJRFXDkKyG57LPA7y4OP8FVpNh3VOcWeJkhaXKGAeFC pcr0eGcJB0WoQ43q+CYn9KLXRZSVxAbEFMVapvzJ7daEgFrHu/PvxXxXgCI+YigR1bhk cexQ== 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=EbILv3AEU1rsdosHz7log8J8EXeADld6z9ly6HtSlLE=; b=iujwli2fhrZxEDZCAedQwddO0YBhR1Oe2NSikb98dbPw4hq9pVkjABg9/B3LEpy2Vo fTGTodCXRDazw0z1k17kQk9XbLpk+ueWNmWAmhA4q0Ynl2PKAQXRTBII8r0+8KpRr2Pl L3CAEBUWGEKtd6gc/MOdeYiK+4hwc7X7OqlCEzxuyBBd6cfiwpPWaJQPZX2eK5vmBIOl lzVzqRLjKMldX4xBpiGFSzbMfxEXmapK8sTPWiiploIpnQVj00r+lRc+rG982K0Wm0G4 Joi+G5Te1dgOylwW6lS0Dq4tkXE4kV4xcGfpWzorzuwo0Q1J+Xubbm0fWZa6NGIt/TKF LgxA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w7-20020a056402268700b00459563e2c60si3717385edd.329.2022.10.14.14.27.18; Fri, 14 Oct 2022 14:27:42 -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 S230010AbiJNVXx (ORCPT + 99 others); Fri, 14 Oct 2022 17:23:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbiJNVXe (ORCPT ); Fri, 14 Oct 2022 17:23:34 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDB351DD8BC; Fri, 14 Oct 2022 14:23:23 -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:23:06 +0300 From: Sergey Shtylyov To: Oleg Nesterov , Thomas Bogendoerfer , , CC: Andrew Morton Subject: [PATCH 06/13] mips: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:28 +0300 Message-ID: <20221014212235.10770-7-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 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: 0 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: 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: ApMailHostAddress: 178.176.75.138 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746699930840815648?= X-GMAIL-MSGID: =?utf-8?q?1746699930840815648?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov Reviewed-by: Philippe Mathieu-Daudé --- arch/mips/kernel/ptrace.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 567aec4abac0..d9df543f7e2c 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -531,10 +531,11 @@ static int fpr_set(struct task_struct *target, ptrace_setfcr31(target, fcr31); } - if (count > 0) - err = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - fir_pos, - fir_pos + sizeof(u32)); + if (count > 0) { + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + fir_pos, fir_pos + sizeof(u32)); + return 0; + } return err; } From patchwork Fri Oct 14 21:22:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2851 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp384046wrs; Fri, 14 Oct 2022 14:29:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5d7fzCIe6ujol9qfOp9frIETII46JGIiHOVw/tP4kqLwOZWiK62NyMFE3h1FUR17Xgddvt X-Received: by 2002:a17:907:1dc7:b0:78d:c153:d64a with SMTP id og7-20020a1709071dc700b0078dc153d64amr4915544ejc.429.1665782968884; Fri, 14 Oct 2022 14:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782968; cv=none; d=google.com; s=arc-20160816; b=wqIweccOcODbluXB4KaMGFdu3WT2u6ickqPGQYHy9M1ww0j2XjDHFdPPHj3TAebTek UW2gBRz4e7l3uTfExod7sIEQyOvkcNiHmZqZwFG8qFNN5cX9FJv7c+279ebQ5196RjIy TAKTILJ2o6WTI2u4G0wCJg5DWR8smdfDAOrQrKloNaLcp5OGfQf+bQoVVEwQTbdAyoY9 cxViVa+E7Q6MWxSlSpTA3/1mH/FRUvV0Lf02iWFFGHjBffg7FM2Aae4gbv/aPTAU28KB JrljZuBcbgSfiEQLknSPo3HbWAI9aKViCrdJfLB1Db/YxIH87/bm5IoS0wmJFs2B2PtU opkw== 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=lSl/i3L1amkU7PAt1gsHNq5hGOQuC/XIP8WX0hUexIY=; b=k8bkYem1VLYYScryXgsTQqHN55aHktohL52yujS7h5F1eBmAr3AAEm5pTbkfQZwfrF Kbipbqa0sayt/HFAwM006lurkmiK+yOU07Z4M2EViMIkLeqOCWOimFMYbDF4XTWFUJxu dSbYsa2rTm1UwhHjPOOOZ3006ivod7iDNHyGynz0Zlmi/B4SgyAUL6POOHvA+HRKxZSq zUYyfS6+0EeTt4BpVXbcs9Hqe1atl7KVyTYnR5lf+UeeULGozm8oNA5CBCkM9JAevLfI sOJr1ddWzZg28+Bw09H/G+CetYiXJdljbX0xqfj++Zh8/VxlgIAwXHqOmtgcGraYTGnI yRMA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw8-20020a170907a0c800b00787d0dfe70csi3022827ejc.981.2022.10.14.14.29.03; Fri, 14 Oct 2022 14:29:28 -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 S229962AbiJNVYD (ORCPT + 99 others); Fri, 14 Oct 2022 17:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiJNVXp (ORCPT ); Fri, 14 Oct 2022 17:23:45 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84FE81DDC22 for ; Fri, 14 Oct 2022 14:23:34 -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:23:07 +0300 From: Sergey Shtylyov To: Oleg Nesterov , Dinh Nguyen , CC: Andrew Morton Subject: [PATCH 07/13] nios2: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:29 +0300 Message-ID: <20221014212235.10770-8-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 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: 0 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: omp.ru:7.1.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.75.138 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746700042483273178?= X-GMAIL-MSGID: =?utf-8?q?1746700042483273178?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/nios2/kernel/ptrace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/nios2/kernel/ptrace.c b/arch/nios2/kernel/ptrace.c index cd62f310778b..9221c15972e6 100644 --- a/arch/nios2/kernel/ptrace.c +++ b/arch/nios2/kernel/ptrace.c @@ -54,7 +54,7 @@ static int genregs_set(struct task_struct *target, #define REG_IGNORE_RANGE(START, END) \ if (!ret) \ - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \ + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \ START * 4, (END * 4) + 4); #define REG_IN_ONE(PTR, LOC) \ @@ -80,8 +80,8 @@ static int genregs_set(struct task_struct *target, REG_IN_ONE(®s->ra, PTR_RA); REG_IN_ONE(®s->ea, PTR_PC); /* use ea for PC */ if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - PTR_STATUS * 4, -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + PTR_STATUS * 4, -1); return ret; } From patchwork Fri Oct 14 21:22:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2852 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp384148wrs; Fri, 14 Oct 2022 14:29:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7r1uzZQ5OR4Qq05DpvGobKoO48RuTqirhbehPxcQipROcB6JZ8LzMRSxhkUP4JUJO5yn5h X-Received: by 2002:aa7:c792:0:b0:453:98b7:213c with SMTP id n18-20020aa7c792000000b0045398b7213cmr5799256eds.159.1665782987345; Fri, 14 Oct 2022 14:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782987; cv=none; d=google.com; s=arc-20160816; b=g2u5iMoKVUlH0+mVLGasX7xs2sMAJttgiPzb8eN41uenxP/pNI0HGl5OdN/vSddMeV 1Q6roT18FrHJcaoTme3HxSf+nv5UBtmxWpsJ4M7Q23IPzqwXZ+eMYsRQF2IFf0/7HQqq kSPS5HAUlri3d/ZS8pT99yRX0HQ8sKwwns+AjyYzAnvWkNQ24cqHvBnRgZBSIoXjzHgK C/h6yApInCuSBIYH7WxR/gbE4i8wHhKPgLSpAjJjeWFIAoHZKH3cjkJnOmtUBWQ2px4f owIh+jcRmlKc9ORhbFGImPDqajh1Eij6cyeyKHQ5H/dgqkmWzBMOoQSHFR/ySE5Qt3Bo e8Tg== 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=wlTBzy66CS0UNKEaev0KlJUX0fNB5Rmo/31fj7UL50A=; b=JQya9cG2Htm+5ZgNDf7fAWhjv+FQv7S4ak38QeetBj/1FbFX6uwOO4Ck64kmdq+REj u0Egt7ZOLSYX2CDOZvZLWyzTNsWuj4tiFJalvZH0JGNYv3VDQYOcWIbVND9tdDRng/uh mdXDUn3yGt0D26ktD+9/HjbfC0M2R7XBQrWXL4yON0BXEW9O/2TxM2RnjjqAFdJsGKB1 V0OcZN2p23JoQZG5epbLLfIOrQxawI7d3CuLRUqjXBJ26eE8jiLUSxkUDunQadUB5krU eE23pV0T6AlyyzBDEoccSbny0JvlA/lw0g3DUmqHGgbdrOJx7Dxjvf7gkpywOzJ+D5mZ OB8w== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr8-20020a170907720800b0077945c44b7fsi3836139ejc.856.2022.10.14.14.29.22; Fri, 14 Oct 2022 14:29:47 -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 S230033AbiJNVYP (ORCPT + 99 others); Fri, 14 Oct 2022 17:24:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbiJNVXz (ORCPT ); Fri, 14 Oct 2022 17:23:55 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D7C1DDC0C for ; Fri, 14 Oct 2022 14:23:46 -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:23:07 +0300 From: Sergey Shtylyov To: Oleg Nesterov , Jonas Bonn , Stefan Kristiansson , Stafford Horne , , CC: Andrew Morton Subject: [PATCH 08/13] openrisc: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:30 +0300 Message-ID: <20221014212235.10770-9-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 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: 0 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: 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: ApMailHostAddress: 178.176.75.138 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746700062106545426?= X-GMAIL-MSGID: =?utf-8?q?1746700062106545426?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/openrisc/kernel/ptrace.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/openrisc/kernel/ptrace.c b/arch/openrisc/kernel/ptrace.c index b971740fc2aa..85ace93fc251 100644 --- a/arch/openrisc/kernel/ptrace.c +++ b/arch/openrisc/kernel/ptrace.c @@ -66,10 +66,9 @@ static int genregs_set(struct task_struct *target, int ret; /* ignore r0 */ - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, 4); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, 4); /* r1 - r31 */ - if (!ret) - ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, + ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs->gpr+1, 4, 4*32); /* PC */ if (!ret) @@ -80,8 +79,7 @@ static int genregs_set(struct task_struct *target, * the Supervision register */ if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - 4*33, -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 4*33, -1); return ret; } From patchwork Fri Oct 14 21:22:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2853 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp384553wrs; Fri, 14 Oct 2022 14:30:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4tyURwGfmpgObzxHtqtvkJGQGc4mfxQAgdwjj2oJeb0E4WxDWRynDHsoQ3pNBipJLF0qZO X-Received: by 2002:a17:907:75d4:b0:78d:efa7:f78c with SMTP id jl20-20020a17090775d400b0078defa7f78cmr5015092ejc.454.1665783050261; Fri, 14 Oct 2022 14:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665783050; cv=none; d=google.com; s=arc-20160816; b=uMNvIl0lNTAzaJRztQIuBaR/w67xMDitlQid+kitEQSKcIxUGgsfK21MsbcEkvSuKR zDtPnO00YtNfY2rrjW3BOPvwPt1ZDfRLaBEM4Mwdxw90aZN+aRGpF9T7TMAG0L8yD6Z1 DpJ09X2lJ/Uo00DjuG4SoqKti5Q7EdJY+zXNpQZ5CqinJXb3XyE61rGdqPhk+P+ghJVL sEl882D4XZoF+V2kEUU+OAwcDfYqQ7KR6MyAQ0dUZ+lrolYal9mD5RoaA5VXbT9jUdg8 qhT6sfPP8xmU3wHiww17fcDmKZGg7xNfY2QhQAWcRvWleqm2BTXSP53KU8EcTXjzvgLW U3Lw== 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=bclS1s0VQ1kdVekNhhmZhsyo793xC9WohWieLffEyyE=; b=Zbfjv199Mj9g0C2TwBZSCnkUuyqxeV/Bv41XROg4wYwcVzopvYQCTpaDgGzDKqPSAr BQ2etcWRjadispGvQxKPQ0id2Ii+uEd7U1DhYPatyBkRW+6lFP9SdMzVCrFLpdFXB4Rm MTFSXTQOJPY5ylPxW2h4bKUL0vzLLCXdNiGpqrMp+dyYdz+xQjmvxf/ftNAeOkEgqbNL EOBmZJnSVoILKoXwHRtzXALmBlw5o0vkgRuw+8KIocKFcXaVLAhnakq+IMHxYbNANKmw TJr1q40XBA/OGWbV8jQYF08hHLknRC2V7yDWf6TqspS5oQM0m5CWdmdYUJYxP1Nf1jTu /c6Q== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs13-20020a170906dc8d00b0077b4248b138si3124171ejc.127.2022.10.14.14.30.22; Fri, 14 Oct 2022 14:30:50 -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 S229970AbiJNVYU (ORCPT + 99 others); Fri, 14 Oct 2022 17:24:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbiJNVYD (ORCPT ); Fri, 14 Oct 2022 17:24:03 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C08891DD890; Fri, 14 Oct 2022 14:23:55 -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:23:08 +0300 From: Sergey Shtylyov To: Oleg Nesterov , "James E.J. Bottomley" , Helge Deller , , CC: Andrew Morton Subject: [PATCH 09/13] parisc: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:31 +0300 Message-ID: <20221014212235.10770-10-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 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: 0 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: 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: ApMailHostAddress: 178.176.75.138 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746700127783478471?= X-GMAIL-MSGID: =?utf-8?q?1746700127783478471?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/parisc/kernel/ptrace.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 96ef6a6b66e5..69c62933e952 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c @@ -424,8 +424,9 @@ static int fpr_set(struct task_struct *target, ubuf = u; pos *= sizeof(reg); count *= sizeof(reg); - return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - ELF_NFPREG * sizeof(reg), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + ELF_NFPREG * sizeof(reg), -1); + return 0; } #define RI(reg) (offsetof(struct user_regs_struct,reg) / sizeof(long)) @@ -543,8 +544,9 @@ static int gpr_set(struct task_struct *target, ubuf = u; pos *= sizeof(reg); count *= sizeof(reg); - return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - ELF_NGREG * sizeof(reg), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + ELF_NGREG * sizeof(reg), -1); + return 0; } static const struct user_regset native_regsets[] = { @@ -606,8 +608,9 @@ static int gpr32_set(struct task_struct *target, ubuf = u; pos *= sizeof(reg); count *= sizeof(reg); - return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - ELF_NGREG * sizeof(reg), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + ELF_NGREG * sizeof(reg), -1); + return 0; } /* From patchwork Fri Oct 14 21:22:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2848 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp383815wrs; Fri, 14 Oct 2022 14:28:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BrmW+ls/Qwolb6pjVFeiIzO5kzwoA92uhAOiOMjkleBjBRTiHh1TOJ7k620HMSa9lKj99 X-Received: by 2002:a17:907:72c2:b0:78d:9aeb:e4f5 with SMTP id du2-20020a17090772c200b0078d9aebe4f5mr4970250ejc.210.1665782932561; Fri, 14 Oct 2022 14:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782932; cv=none; d=google.com; s=arc-20160816; b=OssK7lLpWzekMG6Ca2dm+Rh4bG/L0Js5lKu9pwwoJOKDeaRFUX2OPixt/vN/s3dkX8 cj4jy0jwURy+MnPLHtu/PVuSf5CvvqoNAG+LbkoYQTIni3Kyoy0SyFnKlXG/5aPWsqn3 j4u0yeBPE4IhvuiYzpu8dGRYXnDTME4pdvk4hkAQTR7OqHW6lmIusSQt2v0QDQwrv+BY aP7udvOU9YiJZIynJN5Ls6Iow2bBVLeavF1YpnnBTLAdKgyokprhdV0H6b+Rta5Xxyz8 VXD3F3Ku4T969UJmU+O3/ALwNWg8eI9CBYyVOZly9by8Wl4kvOJmMkvQRqN3Hu+4gqCe PZGg== 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=ZtyUIi+6avwM7c8X31O2RMuS2EtCUpJ9STMvLNMiuE8=; b=Zm4JrqRX/HcKpHnaBREFMo/0I3Hngf8ZyqDA+FHK09gsujdxBtQjJWvT/axkTkXwtK 67a0AP7TkloJkmoPM0jfTwWEOKHXYB4KO9pBAep+k977Doh9hTiQ5WuJ6bxDZ0zgwbrZ RgTE0CnBAQcQle2My3F/26jG/qa65GGNGRziPyH1d0KFs0fkV+RaTNkfnCS497gPTtSy QuKTdFTah9F55A5jO1CSnabiESv91s7TxwQWhIUt+8doV2imP6i/TgMSFHxAIsHDgVn3 kS3b5iN4QrRwU5GxMCej/UBgpGMnKVUyZ+6gdDlxRtqX2c/vQ/kWlBwB2I5qoBB4IDNo Lfiw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a056402354700b004573107a5basi3459507edd.352.2022.10.14.14.28.28; Fri, 14 Oct 2022 14:28:52 -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 S229832AbiJNVYY (ORCPT + 99 others); Fri, 14 Oct 2022 17:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiJNVYG (ORCPT ); Fri, 14 Oct 2022 17:24:06 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BDB11DDDC1 for ; Fri, 14 Oct 2022 14:24: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:23:09 +0300 From: Sergey Shtylyov To: Oleg Nesterov , Michael Ellerman , Nicholas Piggin , Christophe Leroy , , CC: Andrew Morton Subject: [PATCH 10/13] powerpc: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:32 +0300 Message-ID: <20221014212235.10770-11-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 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: 0 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: 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: ApMailHostAddress: 178.176.75.138 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746700004277835826?= X-GMAIL-MSGID: =?utf-8?q?1746700004277835826?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/powerpc/kernel/ptrace/ptrace-tm.c | 10 +++++----- arch/powerpc/kernel/ptrace/ptrace-view.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/ptrace/ptrace-tm.c b/arch/powerpc/kernel/ptrace/ptrace-tm.c index 44045363a903..210ea834e603 100644 --- a/arch/powerpc/kernel/ptrace/ptrace-tm.c +++ b/arch/powerpc/kernel/ptrace/ptrace-tm.c @@ -170,9 +170,9 @@ int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset, (PT_MAX_PUT_REG + 1) * sizeof(reg)); if (PT_MAX_PUT_REG + 1 < PT_TRAP && !ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - (PT_MAX_PUT_REG + 1) * sizeof(reg), - PT_TRAP * sizeof(reg)); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + (PT_MAX_PUT_REG + 1) * sizeof(reg), + PT_TRAP * sizeof(reg)); if (!ret && count > 0) { ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, ®, @@ -183,8 +183,8 @@ int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset, } if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - (PT_TRAP + 1) * sizeof(reg), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + (PT_TRAP + 1) * sizeof(reg), -1); return ret; } diff --git a/arch/powerpc/kernel/ptrace/ptrace-view.c b/arch/powerpc/kernel/ptrace/ptrace-view.c index 076d867412c7..ca0bf8da48fd 100644 --- a/arch/powerpc/kernel/ptrace/ptrace-view.c +++ b/arch/powerpc/kernel/ptrace/ptrace-view.c @@ -267,9 +267,9 @@ static int gpr_set(struct task_struct *target, const struct user_regset *regset, (PT_MAX_PUT_REG + 1) * sizeof(reg)); if (PT_MAX_PUT_REG + 1 < PT_TRAP && !ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - (PT_MAX_PUT_REG + 1) * sizeof(reg), - PT_TRAP * sizeof(reg)); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + (PT_MAX_PUT_REG + 1) * sizeof(reg), + PT_TRAP * sizeof(reg)); if (!ret && count > 0) { ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, ®, @@ -280,8 +280,8 @@ static int gpr_set(struct task_struct *target, const struct user_regset *regset, } if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - (PT_TRAP + 1) * sizeof(reg), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + (PT_TRAP + 1) * sizeof(reg), -1); return ret; } From patchwork Fri Oct 14 21:22:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp383992wrs; Fri, 14 Oct 2022 14:29:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qBRlDzZYRFSddq8s8SoKoDa4WUzrsTAQdFTW8NmYPap6oIsoqKll5oJyqNxocNYrNFb9J X-Received: by 2002:a05:6402:e9b:b0:454:351c:c222 with SMTP id h27-20020a0564020e9b00b00454351cc222mr5965935eda.216.1665782959306; Fri, 14 Oct 2022 14:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782959; cv=none; d=google.com; s=arc-20160816; b=LqsfxbVrGB9H/KdQ2aGdvP5hkoykKDcLWvbWkEsSJtc4uXiYhEmz6y0lFiEfSc/Wo4 ++KzwSgG+CtPPQ8wfKsGXeMHmMGU19obabQjvxrhYcOmjzKXBUjvDSpNKV8cKfNjfY7C tlGrt4sXln7DZBTF3/do5tb5sVGuZb5hsSyzesDbINtV93TljpB8hhslqbUIlLbJEFQ8 DFSgABtcwcSVxbBNz+yobUiXQd4fOkwAzXB+ZYtLcbNfS4i4EoALWxjJHtf4FBwLPqFT YNJwJAm/34HvRZsNkFUyYvIt0zCPNuJ7Rw03WafEt+FY2NI4zvLFaXFVmwWkGLtxIG2Q oj3Q== 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=FhIx8h55YyaRqZWvdt4w38IsIc4JN8zTU5B48fUAQOU=; b=Vb4bZQcty8o2MRxPfYhucXyc7JsdPSRAaZohZXBjEzsVW06X2KTEYp40lBzvJH1Dut BezcTwbuV1RBUHFLyakjVwOhfJNgCpCeMPg+9drDb9TPIAXUTJwniet7kmg5NyFGvPEK 5EkLZoEyojfYbG5qwuxvnWVyy9LsxTB6PKUoVJEHzu4J5M+CvIwmXELHjaazRvgaNiB1 ZEWEqVXdEnxOYe0ipqrGwEu951MUu5G2oFxIlt2p323Nopp/TZKADL3aME6E6dKHytv9 xcrp9fG/Bgxon8/sOfqK6tBsT1OU9DPmmRkDx6rJXDsy7N+MLKainlVsP5q1ywTM1QNH CW2A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hh6-20020a170906a94600b00781b67df7f6si3409434ejb.167.2022.10.14.14.28.53; Fri, 14 Oct 2022 14:29:19 -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 S230077AbiJNVY3 (ORCPT + 99 others); Fri, 14 Oct 2022 17:24:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229982AbiJNVYJ (ORCPT ); Fri, 14 Oct 2022 17:24:09 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D5C01DDDCE; Fri, 14 Oct 2022 14:24:06 -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:23:10 +0300 From: Sergey Shtylyov To: Oleg Nesterov , Yoshinori Sato , Rich Felker , , CC: Andrew Morton Subject: [PATCH 11/13] sh: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:33 +0300 Message-ID: <20221014212235.10770-12-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 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: 0 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: omp.ru:7.1.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.75.138 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746700032596617313?= X-GMAIL-MSGID: =?utf-8?q?1746700032596617313?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/sh/kernel/ptrace_32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c index d417988d9770..36f50ad81e83 100644 --- a/arch/sh/kernel/ptrace_32.c +++ b/arch/sh/kernel/ptrace_32.c @@ -157,8 +157,8 @@ static int genregs_set(struct task_struct *target, offsetof(struct pt_regs, pc), sizeof(struct pt_regs)); if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - sizeof(struct pt_regs), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + sizeof(struct pt_regs), -1); return ret; } @@ -229,8 +229,8 @@ static int dspregs_set(struct task_struct *target, ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs, 0, sizeof(struct pt_dspregs)); if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - sizeof(struct pt_dspregs), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + sizeof(struct pt_dspregs), -1); return ret; } From patchwork Fri Oct 14 21:22:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2849 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp383834wrs; Fri, 14 Oct 2022 14:28:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5dezrtnmPYeQYWwVBRlHG079kpVb/85NR4AgoY0gZVjIZoKNorDw4T2U3DnTmMTwr89LKc X-Received: by 2002:a17:906:58c7:b0:722:f4bf:cb75 with SMTP id e7-20020a17090658c700b00722f4bfcb75mr4946032ejs.450.1665782935573; Fri, 14 Oct 2022 14:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665782935; cv=none; d=google.com; s=arc-20160816; b=BsN21FDg1vw1kJdI2Bo3AOepn/XofwxpId0bQ2rc3KhN9P9Sp1UcOFwbv3nfrdCCoo B2Dv6/qtpDZo3kGmxV2DKbTKtA0us3TTK1IliBpMcBQ04+vr6DnEOqVI3hLn/Z8GusNY pDJ9y75yNL1RFXOYpyochD3Dy1yDbf0AVP1YitcJMrweKhaNsfTBb+feHJ/dIb8yd+1P WFJIwsqemseDuQ/3Vm/wXL92G7AW0fWMcaOKdyNxHXPaepGrTMA7VxMURuvJKnGtWo8D HtXAAPBGg+sVWvZdaAAn32djS9bO54KDgtYzPWj/Nzz31bLIarG4gRD2Fcdz5p1XvGxV 80ZQ== 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=Y1S8PpQdMYtr5/CJGYLTYaRrNqp7QqQ11xugAr8tEp4=; b=ygIBSOD13xpWWQWzOy3WR32k1K5C8tUfQjWmDLxbgmW9Nb67mXxlSahM1gbtt+hd0D kQ6TliAZHQzrEsGQnwqv7FaMW/+jprGCuYmrvtRavs5Mjqzi4cNb8NBjw5tAXcB6evb0 YUR+/Y2UqurfiXkOcAZ2gBUJZfc1rwP7rO651HtmGnQdIkcut+u/SAMZm+RFJgagFIRA A9ycf+VFLutEDR2/c+GC6+bXRx62lVujC9Y11CM0nkjqV+fVNk9JzZuXZa/7Ag1rnjgw /dPrzjQ9gf9L+qTb7VdKOXaL/NDFMKNqkDK1RAnjpD/EvrjQnQZ/Gc80524dgkbNt/r7 iGog== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a1709064c8500b0078200f886bbsi3356042eju.361.2022.10.14.14.28.30; Fri, 14 Oct 2022 14:28:55 -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 S229922AbiJNVYv (ORCPT + 99 others); Fri, 14 Oct 2022 17:24:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiJNVY1 (ORCPT ); Fri, 14 Oct 2022 17:24:27 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FD591DDDEE; Fri, 14 Oct 2022 14:24:09 -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:23:10 +0300 From: Sergey Shtylyov To: Oleg Nesterov , "David S. Miller" , , CC: Andrew Morton Subject: [PATCH 12/13] sparc: ptrace: user_regset_copyin_ignore() always returns 0 Date: Sat, 15 Oct 2022 00:22:34 +0300 Message-ID: <20221014212235.10770-13-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 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: 0 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: 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: ApMailHostAddress: 178.176.75.138 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746700007546787851?= X-GMAIL-MSGID: =?utf-8?q?1746700007546787851?= user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov --- arch/sparc/kernel/ptrace_32.c | 9 +++++---- arch/sparc/kernel/ptrace_64.c | 23 +++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c index e7db48acb838..c273ccebea46 100644 --- a/arch/sparc/kernel/ptrace_32.c +++ b/arch/sparc/kernel/ptrace_32.c @@ -158,8 +158,9 @@ static int genregs32_set(struct task_struct *target, 35 * sizeof(u32), 36 * sizeof(u32)); if (ret || !count) return ret; - return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - 36 * sizeof(u32), 38 * sizeof(u32)); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 36 * sizeof(u32), + 38 * sizeof(u32)); + return 0; } static int fpregs32_get(struct task_struct *target, @@ -203,8 +204,8 @@ static int fpregs32_set(struct task_struct *target, 33 * sizeof(u32), 34 * sizeof(u32)); if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - 34 * sizeof(u32), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + 34 * sizeof(u32), -1); return ret; } diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c index 86a7eb5c27ba..4deba5b6eddb 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c @@ -332,8 +332,8 @@ static int genregs64_set(struct task_struct *target, } if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - 36 * sizeof(u64), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + 36 * sizeof(u64), -1); return ret; } @@ -406,8 +406,8 @@ static int fpregs64_set(struct task_struct *target, task_thread_info(target)->fpsaved[0] = fprs; if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - 35 * sizeof(u64), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + 35 * sizeof(u64), -1); return ret; } @@ -473,10 +473,8 @@ static int setregs64_set(struct task_struct *target, 15 * sizeof(u64)); if (ret) return ret; - ret =user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - 15 * sizeof(u64), 16 * sizeof(u64)); - if (ret) - return ret; + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + 15 * sizeof(u64), 16 * sizeof(u64)); /* TSTATE */ ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tstate, @@ -670,8 +668,9 @@ static int genregs32_set(struct task_struct *target, pos *= sizeof(reg); count *= sizeof(reg); - return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - 38 * sizeof(reg), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + 38 * sizeof(reg), -1); + return 0; } static int fpregs32_get(struct task_struct *target, @@ -737,8 +736,8 @@ static int fpregs32_set(struct task_struct *target, task_thread_info(target)->fpsaved[0] = fprs; if (!ret) - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - 34 * sizeof(u32), -1); + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + 34 * sizeof(u32), -1); return ret; } From patchwork Fri Oct 14 21:22:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 2854 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp384871wrs; Fri, 14 Oct 2022 14:31:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4c008K+ONWVayPLDnZ8FTxppU5OdXNVuf2y3TIratRu+q7MUvSX5AgO8oM4KxMZpfSmK9n X-Received: by 2002:a17:907:5c2:b0:77e:def7:65d8 with SMTP id wg2-20020a17090705c200b0077edef765d8mr5098948ejb.487.1665783092470; Fri, 14 Oct 2022 14:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665783092; cv=none; d=google.com; s=arc-20160816; b=WsPW/rVQPaStRamLTw+jMTebFOqIIaUrdcGJWFZOWrfCjxBXmgsJmToQft6Hbqn+Al 0ZXggg+D0y9Vr5Gg12IK4S4sHd6ZaYao6JCdBtaVUnIaJX3B+kxts1SRZ7KuA1eEBVzq 4+oKw8oejZgoaa1/xveEs+bBNwpaDTpwllSEDkOVOl59VDCHcdgTsZCbkGsWYGstQdGu q6fQoiFyZCKNG2d0QdTroWi5PMHa8UZe3HmhijAYA++X+2HRgDY+6ig+58iIN7HWDj/+ vjTICTtTI6hnZL4ZCmm6txwJ/2TpL24+YXQf69hGwx4kq7OlCQ2IG0JBa68LkyHpJ0GU uGxg== 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=Vf/aS8rsDXUtu7UNNPJZbkDjhE8uc53mfqCmN5GAXDk=; b=ZiZfOT849Vu5uPAymYz3CnWs4xUEDbXmMCqsT54XLbPJiBwieOxA1ItkIXmw9ipC+i ogPJYeJn2sm+rR7Of62DQIpkuJBCamNnmOYTHW4fDTPh949dSYW8sfkLLHiLIjrdXXAp MI835ZVt2qRDF+m+OvDsrq+PT7ZzwNNbF0LC3Ci6JL1IFQLML0Q4puUEr+us3y/6LU0p +ZSJRRkMKF3I5nnG/ZCsk94GL7nPBWM9lRK4ql85cMvG/geTE+8/Qzh77ZZQIEGvxLUC oZelP0LvR3GVsTc06x4m948IYlcGSp2ACMm1scK8sT47t9rfZ1AUyjnIAgSKD9IPmUZ0 EKrA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne6-20020a1709077b8600b007832270e889si2922295ejc.90.2022.10.14.14.31.04; Fri, 14 Oct 2022 14:31:32 -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 S230089AbiJNVZV (ORCPT + 99 others); Fri, 14 Oct 2022 17:25:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbiJNVYx (ORCPT ); Fri, 14 Oct 2022 17:24:53 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9EA51DE3E8 for ; Fri, 14 Oct 2022 14:24:26 -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:23:11 +0300 From: Sergey Shtylyov To: Oleg Nesterov , CC: Andrew Morton Subject: [PATCH 13/13] regset: make user_regset_copyin_ignore() *void* Date: Sat, 15 Oct 2022 00:22:35 +0300 Message-ID: <20221014212235.10770-14-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 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: d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;178.176.75.138:7.7.3;omp.ru:7.1.1 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=temperror header.from=omp.ru;spf=temperror 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746700172098263748?= X-GMAIL-MSGID: =?utf-8?q?1746700172098263748?= user_regset_copyin_ignore() apparently cannot fail and so always returns 0. Let's make this function return *void* instead of *int*... Signed-off-by: Sergey Shtylyov --- include/linux/regset.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/include/linux/regset.h b/include/linux/regset.h index a00765f0e8cf..9061266dd8de 100644 --- a/include/linux/regset.h +++ b/include/linux/regset.h @@ -275,15 +275,15 @@ static inline int user_regset_copyin(unsigned int *pos, unsigned int *count, return 0; } -static inline int user_regset_copyin_ignore(unsigned int *pos, - unsigned int *count, - const void **kbuf, - const void __user **ubuf, - const int start_pos, - const int end_pos) +static inline void user_regset_copyin_ignore(unsigned int *pos, + unsigned int *count, + const void **kbuf, + const void __user **ubuf, + const int start_pos, + const int end_pos) { if (*count == 0) - return 0; + return; BUG_ON(*pos < start_pos); if (end_pos < 0 || *pos < end_pos) { unsigned int copy = (end_pos < 0 ? *count @@ -295,7 +295,6 @@ static inline int user_regset_copyin_ignore(unsigned int *pos, *pos += copy; *count -= copy; } - return 0; } extern int regset_get(struct task_struct *target,