Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2094670rwn; Fri, 9 Sep 2022 08:26:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR6eRqN5jdQjXfRs5nAcGdyYUTsqnnGQA+9PVrZaRUKyXkxCUOlrzA2G8UiE+FVRoHPGAeqr X-Received: by 2002:a50:ee08:0:b0:44f:dc1:fc6b with SMTP id g8-20020a50ee08000000b0044f0dc1fc6bmr11638611eds.15.1662737201182; Fri, 09 Sep 2022 08:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662737201; cv=none; d=google.com; s=arc-20160816; b=bX2nBCEndlXEitO55l/LtKNSuXBgpqNrIZ3Ux8BUCFBaVmBPCuIlrBzm0M8N2Nq/zx xbwitoZAUyYIlgdTtWpQRJTw6TG4VPu+ngV8AwGyvMUxP0xdYZWe+K9n02c2KUDaZd/h 06f6NqXBBkhyzGDbHEUh7NEc8IijF6fqeBbM2YEHRKbbkodvgWYpgRRWAaxo2x6hBjpK K0fAQUnWpjc2tA7alMp7mOVgqC93Xv69hIyfXBxfo7AnEeC+tlzYCja1MTEV7NuHy1UO s+B3A2gPQmqpiiYdGH9jgl0nPemCmSf1AiMBUj4Jbfj9eX4RWzVUKlDRSNdroWVGb1tx 67eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0Meoqct15xRj+ttJhOvrFrl2KTZE/gRtt0ZRxfx4q28=; b=grBXHuKQgzdRIEm3XMnbbj4sYHTsLWIN9nl2O2O1t/Gp3SCf38Ta/kCW6jzS2Tgaex PVW4S05m5Jk7KyNPQJcR0wAA45NPHsb3NA809X5IP6ghQ86AP4mZsUkQxZDGBcD3+Lqd K3r6YfZonXo34NK9LBbHvKRQ/saFTGzjGcHKObSw+wUhUXxx8RX9czW3Spu2QFQkiuPe eMRJM2aQZVQe6WZID/8n38kP7bGmfVsonOWoCpP2pBqDIS4/kFe5sB/5o2pqyjjoIf9K 3ddDJUISulhxKx86KSNe5KiodkEcAkqETiDbP7JTBY+uBQZs0oqYuw46GHwShsIGZP7Q Lqqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FEKMTty2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he12-20020a1709073d8c00b0076f0a1c1501si748314ejc.698.2022.09.09.08.26.16; Fri, 09 Sep 2022 08:26:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FEKMTty2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232198AbiIIOrO (ORCPT + 99 others); Fri, 9 Sep 2022 10:47:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232075AbiIIOrM (ORCPT ); Fri, 9 Sep 2022 10:47:12 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A3CD6F555 for ; Fri, 9 Sep 2022 07:47:11 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id t14so1320438qkt.1 for ; Fri, 09 Sep 2022 07:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=0Meoqct15xRj+ttJhOvrFrl2KTZE/gRtt0ZRxfx4q28=; b=FEKMTty2fiz0be6vD787nTJ7bIzyI0vfMpLUEDFL/DJZmfbonrmDWePsJih+Mpa60R MXUxDdx4bxlY6rOeD1kJr2pMEkTdgmjW2IdgWFR8jE4eDPkoFl/QtuOFqOoNRZpXFJDr h8Swp6fhGK2MYHmzYtQcFvA7NY/Ot6LgoeuRT+igCGnJkxcNSzPrO/Ta3e8Nagha3Y4A qAlasYsnSmYt8N0zmnR48pMVbGmxJH0tdvEuJtaOiAdPk05aEnvDPIwP8tRTcQB+LK0g XBFy8WpfWrqEaa2DIk+U+lpo7fDtz1j/nX9GD2X89pdjdrcBfuy3iepGHlukzFeWguV1 gySA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=0Meoqct15xRj+ttJhOvrFrl2KTZE/gRtt0ZRxfx4q28=; b=ziBLKMqQvHr1rONtE0GCOjyhok2va6cdgx7GrNHZAEhgAI8mQXJn4/QJoBVEtuSyXl cw8mptstPDx+NWepxT+wTkHGlbMos1gXv7cSgEvK357vw8tuOTntdBInFMX+Zok5KQSU xRiBNTaqrW+shJf3+wp+RRKxKGdN2lxmP1yceqLyq0DPUPJGhbtdJKSoMCdGHlqRzD1r yeEeo49JrSi482o14jpdZg+QkM4OB821reo4rcGvJxMMNZvqAf9WdxysbSGpNK7y8L66 Q207qKN4xzofZI29nn507inEkhCOm4KUZ0ubtGcspR3FjgO+1PJFTC+qX1VBvJj8QA3A qcpQ== X-Gm-Message-State: ACgBeo0TG64jSbWiVVhgFtjBE8fxweVUCV2zM1hZvxul/KPpd7xxiu3+ Iod+2/BCyxA9uJLhJ0+MWl0= X-Received: by 2002:a05:620a:4054:b0:6bb:572:3d45 with SMTP id i20-20020a05620a405400b006bb05723d45mr10256490qko.49.1662734829989; Fri, 09 Sep 2022 07:47:09 -0700 (PDT) Received: from localhost ([2601:4c1:c100:2270:cd61:d28a:9f90:9dc3]) by smtp.gmail.com with ESMTPSA id d17-20020a05620a241100b006bb2bca5741sm529092qkn.93.2022.09.09.07.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 07:47:09 -0700 (PDT) Date: Fri, 9 Sep 2022 07:47:10 -0700 From: Yury Norov To: Sven Schnelle Cc: Valentin Schneider , Linus Torvalds , linux-kernel@vger.kernel.org, Alexey Klimov , Andy Shevchenko , Andy Whitcroft , Catalin Marinas , David Laight , Dennis Zhou , Guenter Roeck , Kees Cook , Rasmus Villemoes , Russell King Subject: Re: [PATCH v3 3/4] lib/find_bit: optimize find_next_bit() functions Message-ID: References: <20220827175807.4017673-1-yury.norov@gmail.com> <20220827175807.4017673-4-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 09, 2022 at 02:24:31PM +0200, Sven Schnelle wrote: > Hi Yury, > > Yury Norov writes: > > > On Wed, Sep 07, 2022 at 05:27:08PM +0100, Valentin Schneider wrote: > >> On 27/08/22 10:58, Yury Norov wrote: > >> > +#define FIND_NEXT_BIT(FETCH, MUNGE, size, start) \ > >> > +({ \ > >> > + unsigned long mask, idx, tmp, sz = (size), __start = (start); \ > >> > + \ > >> > + if (unlikely(__start >= sz)) \ > >> > + goto out; \ > >> > + \ > >> > + mask = MUNGE(BITMAP_FIRST_WORD_MASK(__start)); \ > >> > + idx = __start / BITS_PER_LONG; \ > >> > + \ > >> > + for (tmp = (FETCH) & mask; !tmp; tmp = (FETCH)) { \ > >> > + if (idx > sz / BITS_PER_LONG) \ > >> > >> Does that want to be > > > > Yes, I already fixed this. > > > >> if (idx + 1 >= sz / BITS_PER_LONG) > >> > >> ? > > Did you push that already? We're still seeing crashes in CI, and the > 'idx + 1' doesnt seem to be in next-20220908. Adding it makes the > out-of-bound access go away, but the kernel will crash later in the > block mq code: Hi Swen, I removed the whole series and will resend it with an appropriate fixes at the weekend. Hopefully it will disappear in next-20220909 or 10. Thanks, Yury