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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F1D4ECAAD3 for ; Wed, 7 Sep 2022 05:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229833AbiIGFx1 (ORCPT ); Wed, 7 Sep 2022 01:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiIGFxY (ORCPT ); Wed, 7 Sep 2022 01:53:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 947A689CE9; Tue, 6 Sep 2022 22:53:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 304F861771; Wed, 7 Sep 2022 05:53:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 284F1C433D6; Wed, 7 Sep 2022 05:53:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1662529993; bh=ibfwkQ32Rbq5M69B5f3aQ0rXWs/oLVhNIkRFnLi89jw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=f1eAqZIOAFZFsl9R6/RqDMfeNu3ixnPwl2rPr/8Tp/4RfCtrwxxlMnP2U+KM6fqQQ g16x38RJEw2jZug00rcCi1ZhCYXIiqtMBsz3WllmfR3CvTAmxg+gGabxuToW0rmhPO GP91hN4ovuNOHh60JbH0tpk7qKs/9XIEzBk76fr8= Date: Tue, 6 Sep 2022 22:53:12 -0700 From: Andrew Morton To: Yury Norov Cc: syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-next@vger.kernel.org, sfr@canb.auug.org.au, syzkaller-bugs@googlegroups.com, Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino Subject: Re: [syzbot] linux-next boot error: KASAN: slab-out-of-bounds Read in _find_next_bit Message-Id: <20220906225312.263c4493a744cbcb66288283@linux-foundation.org> In-Reply-To: References: <000000000000974e2805e802137e@google.com> <20220906173154.6f2664c8fc6b83470c5dfea1@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 6 Sep 2022 17:45:07 -0700 Yury Norov wrote: > > > The buggy address belongs to the object at ffff888017576600 > > > which belongs to the cache kmalloc-192 of size 192 > > > The buggy address is located 184 bytes inside of > > > 192-byte region [ffff888017576600, ffff8880175766c0) > > > > At offset 184 of a 192-byte region. > > > > So what's wrong with doing that? Does KASAN have an off-by-one? > > Hi Andrew, all, > > This is a bug in FIND_NEXT_BIT(). It should be > if (idx >= sz / BITS_PER_LONG) \ > goto out; \ > > instead of > if (idx > sz / BITS_PER_LONG) \ > goto out; \ > > The fix is in bitmap-for-next, expected to be in -next by tomorrow. > Sorry for the noise. OK... but why is KASAN reporting a bad access from an area which appears to be OK?