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=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 10217C4363C for ; Wed, 7 Oct 2020 06:17:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A101C208C7 for ; Wed, 7 Oct 2020 06:17:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="nBG61JS0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727287AbgJGGRH (ORCPT ); Wed, 7 Oct 2020 02:17:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbgJGGRH (ORCPT ); Wed, 7 Oct 2020 02:17:07 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8622C061755; Tue, 6 Oct 2020 23:17:06 -0700 (PDT) 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=6uV8fR6Bo4rXo+4SAac2dN21jdBEtdjU/gp2f8k5a6U=; b=nBG61JS0gPJssVIiWhM4TYdaX7 NgovjK/cwv32nuTrAfzI2XE875QD1msyMoU/d6LsDTlMx4hWrv/SV06X+dFN4UEKXrtc8PZEwmRSy YT8KOsQpo4OnvU3y5pjfWz7j9kRYCfs7g/BoP3VVzAwr6JWKgyLnQWEnGkPTboBr8OQi1UBRksyDq C8i1EaVzEYBrpBYuGBD0oiOUUeofK+Wd5LzZu8ia4eP5P3K0vQ6XDPRsRMXPna0vvNThUn6OVNGcF 0LhSf36PaXv20v+r4fpqhRvwNeNYaMN3NDu0sns0rnEmMSa1aMFaTseom9/BtqVI2Wz9olyef0AIW FvLpwH7A==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ2l2-00060F-10; Wed, 07 Oct 2020 06:17:00 +0000 Date: Wed, 7 Oct 2020 07:16:59 +0100 From: Christoph Hellwig To: Jann Horn Cc: Khalid Aziz , "David S. Miller" , sparclinux@vger.kernel.org, Linux-MM , Khalid Aziz , kernel list , Anthony Yznaga , Andrew Morton Subject: Re: SPARC version of arch_validate_prot() looks broken (UAF read) Message-ID: <20201007061659.GA21685@infradead.org> References: <0fb905cc-77a2-4beb-dc9c-0c2849a6f0ae@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 02:45:39AM +0200, Jann Horn wrote: > > I think arch_validate_prot() is still the right hook to validate the > > protection bits. sparc_validate_prot() can iterate over VMAs with read > > lock. This will, of course, require range as well to be passed to > > arch_validate_prot(). > > In that case, do you want to implement this? Any reason to not just call arch_validate_prot after taking the mmap lock?