From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14048C4363D for ; Wed, 7 Oct 2020 12:38:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 457D220789 for ; Wed, 7 Oct 2020 12:38:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="X9UpXaNM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="m/UGZtLZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 457D220789 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PBOLc17zy3FISIBoSQ5JLnJj0KMxQasRV99AKKa3ZLQ=; b=X9UpXaNMmQrMBE6FqfdRazpPJ S9WqwllpEmdQ6HrSUVlCUVkZ5hIz1Uhe6dE0zBeEogxBzlACS8oTFf8UL9r5Mt4OnmKYGMNRWSRJK G6R0u0blyAJ9Hcs2IrAkJZM1fFFQUpqfp1KpK+ArSoGqNiQ0ZHBTtkcSuV6OI4aMgE74Zyj2+/9k1 NA8E5nwz6jYiswy5EAtTV2q3f/W17EQr3rImHwpQraPIyvxiHRuo/R2qEM50m6G1z5azrMsy9d2fi vZS2dvsgaiHdLk8lycCKXCuWC/hFA0SPitJ7xpFd2Cb0tLsF/8Gf2zEWeM0MlrAUMyVARq05HR8EU R711Ej6DQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ8gj-00017q-Ea; Wed, 07 Oct 2020 12:36:57 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ8gh-00017Z-FP for linux-arm-kernel@merlin.infradead.org; Wed, 07 Oct 2020 12:36:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7xZSyQPWnxLgrh1E9TtQ37I9TBQZo5pqOmu3lCWY/iI=; b=m/UGZtLZn/vN4y9M1nZ2Zjl0b5 r4S7hsMn5sTBt2bmtoc40cZm4Efl/3LvrLn+d4lq/R+BfXSr0QbkaUI09EE0yR0VInpGzv3o79/II uBhFyWyfkV9sNAlEmUsk8FsNl4rxtjMGElFM3s8f4URICAxq43ok4C/T1+sb24V4vYRihpMzlOrKN 5r/6EMNqG84CGgm2bOjQyhA91w57Xu4lZsyPEq6pthgdsyKg+R04KH919HPs1obLNqsJGyQT13m3F Eaadx2Mxm9FWD9V4lc8SBdo56njL3PvNoxXbRWKanjehqpl+NgfGpELV3eXDObpuR9Y2m+0twAcAu Ri99tb6g==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ8gg-0003hn-4Q; Wed, 07 Oct 2020 12:36:54 +0000 Date: Wed, 7 Oct 2020 13:36:54 +0100 From: Christoph Hellwig To: Jann Horn Subject: Re: [PATCH 2/2] sparc: Check VMA range in sparc_validate_prot() Message-ID: <20201007123654.GB11433@infradead.org> References: <20201007073932.865218-1-jannh@google.com> <20201007073932.865218-2-jannh@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201007073932.865218-2-jannh@google.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Benjamin Herrenschmidt , Catalin Marinas , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org, Khalid Aziz , Paul Mackerras , Michael Ellerman , sparclinux@vger.kernel.org, Anthony Yznaga , Andrew Morton , Will Deacon , "David S. Miller" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > +++ b/arch/sparc/include/asm/mman.h > @@ -60,31 +60,41 @@ static inline int sparc_validate_prot(unsigned long prot, unsigned long addr, > if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_ADI)) > return 0; > if (prot & PROT_ADI) { > + struct vm_area_struct *vma, *next; > + I'd split all the ADI logic into a separate, preferable out of line helper. > + /* reached the end of the range without errors? */ > + if (addr+len <= vma->vm_end) missing whitespaces around the arithmetic operator. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel