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 B4C82C7EE22 for ; Tue, 9 May 2023 12:38:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235478AbjEIMiz (ORCPT ); Tue, 9 May 2023 08:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234580AbjEIMiw (ORCPT ); Tue, 9 May 2023 08:38:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEE1544A5 for ; Tue, 9 May 2023 05:38:51 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683635930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=h4kxchsyaaVSqhuwSS07o+CGltQKN3utS5btQ5n6GOk=; b=kqf931XB/l6jJjbVcpDbGWQDpMM621I9GPKYunJEl668nK77PIuhcP4GdXWfy7qY3tO6KP GmMmJ6e1O3an0+tBKKQ5oOsBxgOB+P4Mg7EpCuOAYRBhmM+R4oCfHe170qzmaUIaEg0TzF 8RVXshJLLVFkMc94xD1CyIqxtZ9HcDtcdNObhmOTEbieR3hZSau2r5GK+UISYWcGbVUCqU E8qlze913J2n1NhJexrkF4GM5OYbJ/6WYbc1MzYs3Ijth3lLhCYycQ2RPMzjl0h1etuDKz 4D0td+usz48YwTBkw2cLC2F7iirw3WGozx8bFfiildaUTe+whvdVW6C8kEo9Gg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683635930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=h4kxchsyaaVSqhuwSS07o+CGltQKN3utS5btQ5n6GOk=; b=l1LQnw/6lgglWF3xjlLVhCqPJtq2tJpF4pPi8QYaPx/H4p9L7oDJwnofJlOC9ga5T513p2 HtOMsyzH4gTyM9AQ== To: Frederic Weisbecker Cc: LKML , Anna-Maria Behnsen , Peter Zijlstra , syzbot+5c54bd3eb218bb595aa9@syzkaller.appspotmail.com, Dmitry Vyukov , Sebastian Siewior , Michael Kerrisk Subject: Re: [patch 02/20] posix-timers: Ensure timer ID search-loop limit is valid In-Reply-To: References: <20230425181827.219128101@linutronix.de> <20230425183312.932345089@linutronix.de> <87zg6i2xn3.ffs@tglx> <87v8h62vwp.ffs@tglx> Date: Tue, 09 May 2023 14:38:50 +0200 Message-ID: <877cth1xyd.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 09 2023 at 11:42, Frederic Weisbecker wrote: > On Sat, May 06, 2023 at 01:36:22AM +0200, Thomas Gleixner wrote: >> Unless you think about the theoretical case of an unlimited number of >> threads sharing the signal_struct which all concurrently try to allocate >> a timer id and then releasing it immediately again (to avoid resource >> limit exhaustion). Theoretically possible, but is this a real concern >> with a timer ID space of 2G? > > I didn't go that far actually, it was just me misunderstanding that loop and > especially the (id =~start) part. Now I got it. > > I guess the for statement can just be: > > for (; start != id; id++) My brain based compiler complains about uninitialized usage of @id. I'm pretty sure it's rightfully complaining and a real compiler would agree, no? Thanks, tglx