From patchwork Mon Sep 21 13:34:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 7230441 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 50F289F32B for ; Mon, 21 Sep 2015 13:38:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 891A02065B for ; Mon, 21 Sep 2015 13:38:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C8C420623 for ; Mon, 21 Sep 2015 13:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932562AbbIUNh4 (ORCPT ); Mon, 21 Sep 2015 09:37:56 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:37352 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932311AbbIUNg2 (ORCPT ); Mon, 21 Sep 2015 09:36:28 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NV1005WK4GOJI60@mailout2.w1.samsung.com>; Mon, 21 Sep 2015 14:36:24 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-02-560007d88ced Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 80.77.04846.8D700065; Mon, 21 Sep 2015 14:36:24 +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:24 +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 35/38] ptrace: remove invalid check Date: Mon, 21 Sep 2015 15:34:07 +0200 Message-id: <1442842450-29769-36-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+NgFmpjluLIzCtJLcpLzFFi42I5/e/4Vd0b7AxhBmcW8VjcWneO1WLjjPWs FhO3t7FYXN41h81izp8pzBZrj9xld2DzeL/vKptH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw Zex68IKx4BRHxbf1L5kbGC+ydTFyckgImEg0tV1igrDFJC7cWw8U5+IQEljKKHH58wxGCKeJ SeL02y1gVWwCmhJ/N98E6xYRUJDY3PuMFaSIWeAUo8S1Z81gCWEBY4mlSw6zgtgsAqoS82ff ZAGxeQVcJD7suAC1Wk7i5LHJYDWcQPEDB7+A1QgJOEscWHKEaQIj7wJGhlWMoqmlyQXFSem5 hnrFibnFpXnpesn5uZsYIaHzZQfj4mNWhxgFOBiVeHgdBP6HCrEmlhVX5h5ilOBgVhLh1ZkF FOJNSaysSi3Kjy8qzUktPsQozcGiJM47d9f7ECGB9MSS1OzU1ILUIpgsEwenVAOj8dHjllUT F12a8bc8lFkh8lStj4WYd9bmpudTYtbXHzzySrre3LpLan2dquI1/eKSO7/erfeXXvlQ26g3 KFpoQ+lu5sIDh95tm3U/XCB1P9cdt29xpypFvKof2phUPJp+eXFYN2Pdu5cqzMyx+R433wnG bwooNWjXnh1zvH+eZ53fjqU+l4uUWIozEg21mIuKEwH2H1ovGQIAAA== 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_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index 5cea973..138b2b1 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c @@ -395,7 +395,7 @@ long arch_ptrace(struct task_struct *child, long request, unsigned long tmp; ret = -EIO; - if ((addr & 3) || addr < 0) + if (addr & 3) break; if (addr < sizeof(struct pt_regs)) @@ -423,7 +423,7 @@ long arch_ptrace(struct task_struct *child, long request, this could crash the kernel or result in a security loophole. */ ret = -EIO; - if ((addr & 3) || addr < 0) + if (addr & 3) break; if (addr < sizeof(struct pt_regs)) {