From patchwork Mon Sep 21 13:34:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 7230451 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D3EF2BEEC1 for ; Mon, 21 Sep 2015 13:38:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1528D2065B for ; Mon, 21 Sep 2015 13:38:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29B8120623 for ; Mon, 21 Sep 2015 13:38:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753142AbbIUNip (ORCPT ); Mon, 21 Sep 2015 09:38:45 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:43643 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932468AbbIUNg1 (ORCPT ); Mon, 21 Sep 2015 09:36:27 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NV100ET24GO9D30@mailout3.w1.samsung.com>; Mon, 21 Sep 2015 14:36:24 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-01-560007d7f8a7 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 10.77.04846.7D700065; Mon, 21 Sep 2015 14:36:23 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NV100LNT4DTKI10@eusync3.samsung.com>; Mon, 21 Sep 2015 14:36:23 +0100 (BST) From: Andrzej Hajda To: linux-kernel@vger.kernel.org Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , Eric Paris , linux-sh@vger.kernel.org Subject: [PATCH 34/38] perf: remove invalid check Date: Mon, 21 Sep 2015 15:34:06 +0200 Message-id: <1442842450-29769-35-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1442842450-29769-1-git-send-email-a.hajda@samsung.com> References: <1442842450-29769-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplluLIzCtJLcpLzFFi42I5/e/4Vd3r7AxhBtdPmVjcWneO1WLjjPWs FhO3t7FYXN41h81izp8pzBZrj9xld2DzeL/vKptH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw Zay5e5WtYBZ7xcR3Z9gbGN+zdjFyckgImEhM+fAAyhaTuHBvPVsXIxeHkMBSRomG/9OZIJwm JokHR/6DVbEJaEr83XyTDcQWEVCQ2Nz7jBWkiFngFKPEtWfNYAlhAUOJJ/cOsoPYLAKqErO2 P2PpYuTg4BVwkVh6Nxdim5zEyWOTwWZyAoUPHPzCAmILCThLHFhyhGkCI+8CRoZVjKKppckF xUnpuYZ6xYm5xaV56XrJ+bmbGCGB82UH4+JjVocYBTgYlXh4HQT+hwqxJpYVV+YeYpTgYFYS 4dWZBRTiTUmsrEotyo8vKs1JLT7EKM3BoiTOO3fX+xAhgfTEktTs1NSC1CKYLBMHp1QDo+3c R7dfHRE//GtXcH6QS1PJqa0eTZF2D7p1TecvvLfR9cJak5UVKaZn3PaL3HSeyWa5N2DDjAn+ 108EX8m82ub0c+LkOt+vN+qj+/dPj5ij+u1Q34RK2QK9mrJJO33WC8ZdY2jTcTrx4FSb/u7a 7eK+KQ/qL3V9mKJwyTSJ41nj9wU7DtV7uSixFGckGmoxFxUnAgBmvskDGAIAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unsigned values cannot be lesser than zero. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- arch/sh/kernel/ptrace_32.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c index c1a6b89..6125ce9 100644 --- a/arch/sh/kernel/ptrace_32.c +++ b/arch/sh/kernel/ptrace_32.c @@ -419,8 +419,7 @@ long arch_ptrace(struct task_struct *child, long request, case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ ret = -EIO; - if ((addr & 3) || addr < 0 || - addr > sizeof(struct user) - 3) + if ((addr & 3) || addr > sizeof(struct user) - 3) break; if (addr < sizeof(struct pt_regs))