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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19CD8CD4F59 for ; Thu, 5 Sep 2024 07:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:References:In-Reply-To:Subject:To:From:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rODZ8Mcl6ziSPnpnBj5WSdN83ODOngMe8fjgQSCk7sQ=; b=guQmKx2PEYdcO7tETcyYTBANs3 zkT8WigBLc7oikNXRZs1KFEEPugde+GB2sac5CVD92bUFyyuAeQrB2/2fIwaHqrFLbrZp4PqvcVgG Po+8AksJdq4kLE+pHwx7RCwKG9GDfKsnCHOchZ2/Xidw1X7l5JdiMpG0qYRQM4/8Jwsjh2GeoiIZh oSRomWltHzxZmJ5NHL8/tie4Dn4KxR+krl5m+P9BQq9QFrUFKlGNBYwRGTYITSf9+6/tv/VH09YYE utmrXll4YWYIKoOQ/wAlyKK5x3ZpOtkqWoRCLLEUIYe0oItvc3JntZiE7hA01OZdjFF24kB37k8LL FXiTtaqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm6wx-00000007N5L-32qN; Thu, 05 Sep 2024 07:30:39 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm6vw-00000007MuQ-1zNZ for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 07:29:40 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1725521372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rODZ8Mcl6ziSPnpnBj5WSdN83ODOngMe8fjgQSCk7sQ=; b=4VsvWJhIgO6iOu+WSABF/Vd1TbWZKTYdL32xWfsUmmStHG21H4HY8N8sXsWIjisOLPNUal MTUO08TZSvAjuwxdP2srzHxOq3V6L2eaPk9EZV83YHlyRBKzPDb9sUOWpOdYqPrsNAPhFg 0gclCQ9rYw5Xp2HMAgSQ3N3ZJg7dabo76xtiv0gy6ihqBXpDfObqppemAP1cdT/DxB6bhE vVpTu8mwkmdw+0cWniDg/GAn21DfKhzBToj0du4zYNpiJUdpxRMEPxcESoDXPAPtEc7wSc nWqt3hFnjITzqQD/NM7rJjr3EWDH4HDr6KhueU9+ElPZCPFjmu//u1qcwZNEPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1725521372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rODZ8Mcl6ziSPnpnBj5WSdN83ODOngMe8fjgQSCk7sQ=; b=CDHsX2g9hyGqoMqhMDrhQ+Cos/UxfKayejpg0mJp/IGg/Ysu5mWwm3r9wIryQFc3NcZ0DV R/wzh7sdoAxrvWCw== To: Sergey Shtylyov , linux-kernel@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] irqchip/gic: prevent buffer overflow in gic_ipi_send_mask() In-Reply-To: <048ff3bb-09d1-2e60-4f3b-611e2bfde7aa@omp.ru> References: <048ff3bb-09d1-2e60-4f3b-611e2bfde7aa@omp.ru> Date: Thu, 05 Sep 2024 09:29:32 +0200 Message-ID: <87cyli5zj7.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_002936_675626_6CB95798 X-CRM114-Status: UNSURE ( 7.19 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 04 2024 at 23:23, Sergey Shtylyov wrote: > ARM GIC arch v2 spec claims support for just 8 CPU interfaces. However, > looking at the GIC driver's irq_set_affinity() method, it seems that the > passed CPU mask may contain the logical CPU #s beyond 8, and that method > filters them out before reading gic_cpu_map[], bailing out with > -EINVAL. The reasoning is correct in theory, but in reality it's a non problem. Simply because processors which use this GIC version cannot have more than 8 cores. That means num_possible_cpus() <= 8 so the cpumask handed in cannot have bits >= 8 set. Ergo for_each_cpu() can't return a bit which is >= 8. Thanks tglx