Message ID | 1ec2adea9665ea1a7e2fcbad029bc678@codeaurora.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15D3414BD for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 9 Nov 2018 17:59:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F23D92EE34 for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 9 Nov 2018 17:59:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E60F22EE3F; Fri, 9 Nov 2018 17:59:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E1212EE34 for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 9 Nov 2018 17:59:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14B0B6B0714; Fri, 9 Nov 2018 12:59:36 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0D36C6B0716; Fri, 9 Nov 2018 12:59:36 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE0076B0717; Fri, 9 Nov 2018 12:59:35 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by kanga.kvack.org (Postfix) with ESMTP id A80F16B0714 for <linux-mm@kvack.org>; Fri, 9 Nov 2018 12:59:35 -0500 (EST) Received: by mail-pf1-f197.google.com with SMTP id f69-v6so2004075pfa.15 for <linux-mm@kvack.org>; Fri, 09 Nov 2018 09:59:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:dkim-signature:mime-version :content-transfer-encoding:date:from:to:cc:subject:message-id :user-agent; bh=7KWSOjDbQ4GFdnuKyEV4tU7+oAo8f3vuS6qtobacVtc=; b=prgJ41lj20yXh+2H2edhnjsOH3bO4hemeMzR7950dOTw6b118ZqGad716htL/4Qvck x83GSVH0lUxFR3Yf+UeSw0JxK2wyaW6tsCwSn7erliXH+rsJksH9kK+pb8LGr8/49bS9 xItixbNqNr5cVUsb7VIkHimjv807G8cs7Z2OxeKjBBRBLmygBdPTpAiOLszTfLTkELa0 +4XUDGB7bh+ig7VMqINlm81+E5XbLP977QfvvKazb1U6xDu1RlvuxOmZ9MKXf8wSqk8r 65213zW/4bmWLzZsorwLfP9Lhbl8q3aE7HKgrSi9wdYH9TmxrsNaE0eSTc4vgfv9EL9w qAug== X-Gm-Message-State: AGRZ1gI+17H2H3jk5ezZhaNGG+7YGvv4DrRnsuXLAJfIQOrk3wJzLjVF psP6JPFn3vqK0spc79y6A5UtU0FfnWqnYQMm83hS7GpKDNaFNJnur5EtVBgEYp1FTAMAc+i5gw1 TtbLD+cLn907YpiTEeUe9JvwZxGsJ7thDBV7nXUxgd4IpdlO93vrtgdT9HYjb2KjzGg== X-Received: by 2002:a63:f006:: with SMTP id k6mr8367495pgh.259.1541786375222; Fri, 09 Nov 2018 09:59:35 -0800 (PST) X-Google-Smtp-Source: AJdET5fIjFmeM/ZKfdXxLP0SOP2vp3y394FfR6GsdYCqtCntAWLrt599P0vw6e6sJQnDGIwYpjyy X-Received: by 2002:a63:f006:: with SMTP id k6mr8367463pgh.259.1541786374486; Fri, 09 Nov 2018 09:59:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541786374; cv=none; d=google.com; s=arc-20160816; b=tRUTKMoEKGA1L8GGDH6oMM/5MxUV4bU1hyzHgBuAH7rkOkzQa5U1dRovmyff5O2YHY XchbiyCMoqKE/5rS7P5opwzIse7GgEgtPaBmjm2aj05B8mrCcQiWn7tcAWfpJmXq0YC+ yDr58GzRq8j8qRjxxYQknDdaiYn9Tu/ml1JRFrztgHDDcvR4cM+pJ/srGLgw6GlKWutt CjJHutwhiDE7gMKsnB/qyyB57nljc/CczgosthLxxY8BK1z86TOt351wqzEKzUUCfKyG 7Xsn/6YejlgREzLaoyZlWbRld3okPSvxw4lOOfzbwdPHGjD+AugZp6XToetpdVSZsVmB TI4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:message-id:subject:cc:to:from:date :content-transfer-encoding:mime-version:dkim-signature :dkim-signature; bh=7KWSOjDbQ4GFdnuKyEV4tU7+oAo8f3vuS6qtobacVtc=; b=ZN6wgDkwy7Wsbamn1LPXOqwrZ/kRE6m9k+OmrG39lpyXIEQgBPAwcUj1UGVnOZOGwD KS4dBorWiXMe2CQtQUuPArDiGjOFj0POJ74D51gPU4nYpnJKuQn8/xt4SKVP/PYoJg6a +Rfi9dSBlNlwGqpIWDISYY5/MhPhOZZsRn2hLMUWXbwrzQ5WQ+c6EX6ORu1NP2X10Yxr URWgSTd6OgSfKk9ftKoW3cmQtTPU8S0n+7rip/Iy3wLgy/9muN2Jk/gYN/6PTICANQou +0tMVUeTX87xg78NHQA2SpbHBRfIZR6G6XXfFRUvkclX151pB1gxJoTzhyxNl8KiZIEx bxgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QEukdfJC; dkim=pass header.i=@codeaurora.org header.s=default header.b="Vbtx/4Xi"; spf=pass (google.com: domain of isaacm@codeaurora.org designates 198.145.29.96 as permitted sender) smtp.mailfrom=isaacm@codeaurora.org Received: from smtp.codeaurora.org (smtp.codeaurora.org. [198.145.29.96]) by mx.google.com with ESMTPS id v14-v6si7330675pgi.5.2018.11.09.09.59.34 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 09:59:34 -0800 (PST) Received-SPF: pass (google.com: domain of isaacm@codeaurora.org designates 198.145.29.96 as permitted sender) client-ip=198.145.29.96; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QEukdfJC; dkim=pass header.i=@codeaurora.org header.s=default header.b="Vbtx/4Xi"; spf=pass (google.com: domain of isaacm@codeaurora.org designates 198.145.29.96 as permitted sender) smtp.mailfrom=isaacm@codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 05CAB601A8; Fri, 9 Nov 2018 17:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541786374; bh=6sycMaK4EbiLyb/ZULD9b6r+/vT7va1ht1YHo8m3LVk=; h=Date:From:To:Cc:Subject:From; b=QEukdfJCXs3iFYfQQUtJ3Zyhigl7kzocxJ1umoDL9XXaQwvwiNBXwAsD1PXsdCuY4 8b6XHB7W1rzbWQ2ZCjCOJN1aZI3aSajsFFuFQ8KdkJZeFNvGMGDQkKTfV7bwiKENoq 4c6gwEo0ZHxc4kPE9j+7hoCs1cYblmIPRFv4QKE4= Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 76EF960791; Fri, 9 Nov 2018 17:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541786373; bh=6sycMaK4EbiLyb/ZULD9b6r+/vT7va1ht1YHo8m3LVk=; h=Date:From:To:Cc:Subject:From; b=Vbtx/4XidlzuSaqDHO64cvshO6J+I5YIMQDsWS7yOpJdpU+h0b4Gm+hhqdsz5rlbs tWxNkXnJqHc6VLA6GlsiVF2ITtbV/R9jrQE3kEmQjlq766Tgb5qTYAXDffJFIilkWZ LE4TwdDjzunauprMVXsrh5bjoKZdx7yQslgY2+y4= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 09 Nov 2018 09:59:33 -0800 From: isaacm@codeaurora.org To: keescook@chromium.org Cc: linux-mm@kvack.org, psodagud@codeaurora.org, tsoni@codeaurora.org Subject: Potentially Incorrect Wraparound Check in mm/usercopy.c Message-ID: <1ec2adea9665ea1a7e2fcbad029bc678@codeaurora.org> X-Sender: isaacm@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Potentially Incorrect Wraparound Check in mm/usercopy.c
|
expand
|
diff --git a/mm/usercopy.c b/mm/usercopy.c index 852eb4e..0293645 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c @@ -151,7 +151,7 @@ static inline void check_bogus_address(const unsigned long ptr, unsigned long n, bool to_user) { /* Reject if object wraps past end of memory. */ - if (ptr + n < ptr) + if (ptr + (n - 1) < ptr) usercopy_abort("wrapped address", NULL, to_user, 0, ptr + n);