Received: by 10.192.165.148 with SMTP id m20csp3058682imm; Sun, 22 Apr 2018 23:05:28 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Lm841LrfegwWey4TtIIpStRWwWUP9X6LWcXfuoxLBu28dUbVv2r3So//s1oe8F+jiQW9H X-Received: by 10.98.31.20 with SMTP id f20mr18942114pff.196.1524463528729; Sun, 22 Apr 2018 23:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524463528; cv=none; d=google.com; s=arc-20160816; b=o5fUbCkPHfnNHmagw34cV8ZqfKIIG0WTonuWHwfeAzxapVFtcz0RC5FknDJjskSrjB vTMTKlzErFK0WtywRathQUJNb6BkOi7bZYElz184MiEHASy6prqbuzNaaxVmB/uIBEXB 0YZMIhRpgwzvsHv7QTKJ6xAt2ksgb5YrDr1IakteSywGrTONxVbcPa7eT2m2PSgqgDmQ pqadTupFplYtv/IbJvn0DEXrOjwYNUnigUg9usX2J2P9ylVbW6czPHv3rWyW79bNe/FF g39fxnkkl8O1cQavynAi9cP+hUBq70p2iuxYvfZqDr1p9ZCghwE874FwhPWcpAvLfopp iKUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=s2qVs4QLuRY0Qky4GpxzP8uSWrUOxYpMctRcWlcQimg=; b=qGarC3z/mVk8FhCsre2pLqEsSw1DR/hqJ3zJZQMnBJAySfKswDpWjP04j5oIsJVDvI LYBikjZV7mMVCZleP/OL4JR54aEP4XV5S/w4xb67tWg5+BkoAKIszNpOmtZWYmEeMVxO 1A8F3ciM6UZSH1hoelRaheKYSVj5VdURvp49krUXl3W1qbHbrH81wvhmPKsd5WDlgkbf ds9jQxwlC4EdlXJ7l2YhvEvhkX6d+j42Mbl6fzGmqiaKyUOCE16b+PRh3Zk9RaK/eVPT sPNncu15ud/qAFN+KQkqMRT1g1EhSFnIjAbJYaAb4iSDap+xCQns3NjXxFQbxYPDWviP t2Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=YmaU9ux4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s36-v6si10803256pld.114.2018.04.22.23.05.14; Sun, 22 Apr 2018 23:05:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=YmaU9ux4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510AbeDWGEB (ORCPT + 99 others); Mon, 23 Apr 2018 02:04:01 -0400 Received: from imap.thunk.org ([74.207.234.97]:43992 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbeDWGD5 (ORCPT ); Mon, 23 Apr 2018 02:03:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; 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:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=s2qVs4QLuRY0Qky4GpxzP8uSWrUOxYpMctRcWlcQimg=; b=YmaU9ux4ODpoRloyYFnmVq0Li1 NEpta+I/QFtZ0es4WqpULoa+XR+hObFE4n72ww5FWvcjkfTdx9imfqVv8qVze7eqaVI3zTpat6yOr 4OzZPpYxG4eqZRactH4qzHfPNM4WDCViM7zdAROZiy7coUZUcKmulq3mSlAV0EN0VTbg=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1fAUZu-0002rV-1g; Mon, 23 Apr 2018 06:03:54 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 919917A3618; Mon, 23 Apr 2018 02:03:52 -0400 (EDT) Date: Mon, 23 Apr 2018 02:03:52 -0400 From: "Theodore Y. Ts'o" To: Ben Hutchings Cc: stable@vger.kernel.org, Wen Xu , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH 4.9 37/95] ext4: add validity checks for bitmap block numbers Message-ID: <20180423060352.GA8194@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Ben Hutchings , stable@vger.kernel.org, Wen Xu , Greg Kroah-Hartman , linux-kernel@vger.kernel.org References: <20180422135210.432103639@linuxfoundation.org> <20180422135211.941652389@linuxfoundation.org> <30c688b5783a5779811ce68893b7001390b9e200.camel@decadent.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30c688b5783a5779811ce68893b7001390b9e200.camel@decadent.org.uk> User-Agent: Mutt/1.9.5 (2018-04-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 22, 2018 at 10:54:23PM +0100, Ben Hutchings wrote: > > offset = blk - group_first_block; > > - if (!ext4_test_bit(EXT4_B2C(sbi, offset), bh->b_data)) > > + if (offset < 0 || EXT4_B2C(sbi, offset) >= sb->s_blocksize || > > + !ext4_test_bit(EXT4_B2C(sbi, offset), bh->b_data)) > > Isn't sb->s_blocksize a count of bytes? If so, doesn't that mean that > we should be comparing with sb->s_blocksize * 8? Yes, nice catch, Ben! Can we temporarily drop this patch from the stable queue until I can get a fix in? In practice this shouldn't be a problem because of the default ext4 layout with flex_bg. But we should definitely get this fixed before we let this flow into the stable kernel. - Ted