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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37466C38145 for ; Wed, 7 Sep 2022 05:53:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84E606B0072; Wed, 7 Sep 2022 01:53:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D6508D0001; Wed, 7 Sep 2022 01:53:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69D9E6B0074; Wed, 7 Sep 2022 01:53:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5457B6B0072 for ; Wed, 7 Sep 2022 01:53:17 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1EA4080A12 for ; Wed, 7 Sep 2022 05:53:17 +0000 (UTC) X-FDA: 79884221634.07.13A31D7 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf13.hostedemail.com (Postfix) with ESMTP id 9954220072 for ; Wed, 7 Sep 2022 05:53:16 +0000 (UTC) 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 ams.source.kernel.org (Postfix) with ESMTPS id D7B88B81AD3; 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 ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=f1eAqZIO; spf=pass (imf13.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662529996; a=rsa-sha256; cv=none; b=Wg/nwpA4CsRxSyN1Hge7bIZ+Sdpn57YsAI+KHhns0UmomCi/ZZn/nwoaw7K/Kag57P6cSZ M2dM8DugK/KOnZFWIsEy7LNMQ+0LV9XaxbpMjQP1oOr/q+WpF2+DvdmTZmSqWICgCEGj7d 2w42kNvsu/XW7M1YnJy9bCZyfeDomyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662529996; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qqvLEVOnIiVHyO4aKrAh/RzIHCE5UmidPGj9z3+CObM=; b=y+1ljsUsco7hlHSAyoNiNDikQpB3ZJ48tUVZkeKf+1fRtlVCJrs+F5ztJJKEu8e+aTnH8w 8mL8NYkNe2fOKjpRci0C8q2Q7iROwi8I1UfuDoUpjoZqi5kJItvF0mi+8ceVg08MMTX7IE ezN71U4FzHrK+ynbIuxKUZMDKocR0mM= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9954220072 X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=f1eAqZIO; spf=pass (imf13.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: s863tj91spkni3684riyg4y87d1mbia5 X-HE-Tag: 1662529996-705233 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: 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?