Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp585753pxb; Mon, 25 Oct 2021 14:21:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdG7ljnsJecSgZ8PrVcXvz8aSPI+0btEXLYcLSzJtWLp42Zrkj9L/a9EXoQuwfT9sPo6pp X-Received: by 2002:a17:90b:694:: with SMTP id m20mr19138470pjz.198.1635196877483; Mon, 25 Oct 2021 14:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635196877; cv=none; d=google.com; s=arc-20160816; b=U6fhKSB9mqI/pwQXVv7BzHxpQg8XsUXswO+ZtLoB1tCrC2nc9Hh6kZKFitxO+Mow9O RPJ8J1785D2RN61C2F6oPtYnt1jzYq1aNFgoAklJ5BGyK7keiU/Z37rYgqaArtagavie g6W3jlckqA7jz1GRNnMFgboARfX/QFY7kMf+k6My9X8E5b5VL4pu3Pm1SDw/1uIRl4FR siGbb2vdPLeKwGM/NDKsuJcuFvucs7ZU+TdOPtRpngkC1jSHiuzNmxOs8qxA9fPN3ad+ nv0nA0V6L60nrfecKcQ2jQynlALr0Q0I4AFBY9pL2MlzG3mKzdHoqRy0XlGXMF8x9en1 mobA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=7fmJP5lBRGfiXbGpPlztbnu2KecVWtM9Sy4dgoFvHhQ=; b=N+bAQ4LkcMG38h9QljgMVwrY9oDB5nD92Uwm4XrXvt1Xqz5XJQpAK5p3Il5MgUId6L 3YvZolukSb4Nf2dkvhzG1jdBSDYwpEj6pJTWahyngOnEeRch0vPQ1tIg0P4I7eWNTtcP sKawTIjUDog5WoneHVkMABGDcTKdddcQU6xv44uxsmHg02woy0G/rl8TYHwu+420hYsW oitgd9wnz+JSd2m5hgoXi5z+TtZIb2TThrafPrXYqfAgcJNFFOlta5Nn1QoIMYb2s1DF nOmypCifQs0KAtgyPaPhr+IlcGDyVfFR+KwdgWYueJkFvh9GBw2DJLP5U04/4DLnsBSz S+bQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si23535822pls.335.2021.10.25.14.21.02; Mon, 25 Oct 2021 14:21:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231708AbhJYNcz (ORCPT + 99 others); Mon, 25 Oct 2021 09:32:55 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:34524 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231302AbhJYNcy (ORCPT ); Mon, 25 Oct 2021 09:32:54 -0400 Received: from localhost.localdomain (unknown [124.16.138.128]) by APP-01 (Coremail) with SMTP id qwCowAD3_gpHsXZhWypRBQ--.20683S2; Mon, 25 Oct 2021 21:29:43 +0800 (CST) From: Jiasheng Jiang To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com Cc: linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: Re: Re: [PATCH v2] sched: Fix implicit type conversion Date: Mon, 25 Oct 2021 13:29:41 +0000 Message-Id: <1635168581-2426805-1-git-send-email-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: qwCowAD3_gpHsXZhWypRBQ--.20683S2 X-Coremail-Antispam: 1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.16.138.128] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 25, 2021 at 12:43:55AM +0000, Peter Zijlstra wrote: >> The variable 'n' is defined as ULONG. However in the cpumask_next(), >> it is used as INT. >> That is vulnerable and may cause overflow. >> For example, if the value of 'n' is (2^31 - 1), then it can pass the >That would need nr_cpu_ids to be that large. How's that going to happen? First, maybe it is hard to exploit it now, but who knows the future. Second, the patch cost much less than the loss caused by the unexpected input. Third, it is universally accepted that the implicit type conversion is vulnerable. Therefore, it will set an example for others that having the good programming custom.