Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp725430pxf; Thu, 1 Apr 2021 11:53:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1iMkMm4v9LhwZcP/Ah2k4UnzdhCm6MCQ4DwABM5blfAQfnsMe7kRljBZbTmUPM9iMeSC9 X-Received: by 2002:a02:cad9:: with SMTP id f25mr9186356jap.26.1617303222843; Thu, 01 Apr 2021 11:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617303222; cv=none; d=google.com; s=arc-20160816; b=iq9DOKhOg1Z186tDG9V6zhxbRG2BFP1OMLOJLe1KnVayCAtAI/x0WjtZJfb9M2yLDo 9WVfA/ELIwryx2TZQcT9BVaja5znCSIWqrumh8kabXN3rfhEl9QyNRprEjRb0kgWw3Pr 8xqJYuly5NMHGDrnxjjA2pWK8r5/HPP/rpDUkqJKbWAxF2UEorLOy/1082hijlwSxjV/ pLYL54E5HY+4zlIWPoh0Dh+erNJgrb/sPBst889y9kHYIoQuWHDkp5pGvF1YvIxfJNwz dCs8pnMACqi+kqWL8+8g7/uu53b5M7XdCtBSKzfg4aMb0OwUEucPKdOl7V0w640yRiCF YnrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FiSNq/i9zBDRiTrZiIImQcjG6pk3T0nVdBU85Gff+8Q=; b=q3MQlcV7pMf08pwKH4t2xrTKcWq80Wu0Dvovz3eWaKm4ULu4/skqVQAo8r0kJDZMb7 aufd150FnpVb7KZjM5BAkLDVhIqEW4kzk5KNkf9PzOQHaMjT2NkXgVZNczjnv0D9OGV+ kT9r/hXfL4+UNSRgWA4GgEwhaBQM9z1utCDRWqzgH6S7PADvW49Ie1iOELIC1XmUjEmb rySWPWQD5/srtfQE2TO7/e1NU5wpcY9g7AVtjKDuvgaJwAWiHsXpdEpyEnVRQ4HOvfum jP4+iCR+AFW0xRheWPgO+7rS4ile2hqBZJwltZ3uQhhmIscm3O0C4O7//DTgOoHeoWS0 8oAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sUl58mLk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si5521568jaq.71.2021.04.01.11.53.29; Thu, 01 Apr 2021 11:53:42 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sUl58mLk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239610AbhDASvC (ORCPT + 99 others); Thu, 1 Apr 2021 14:51:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:57610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237185AbhDASdC (ORCPT ); Thu, 1 Apr 2021 14:33:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 98E606137A; Thu, 1 Apr 2021 16:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617293200; bh=pMvThrYGS+kTLiULFh4dIBeWNAKzy5JLuHHDyI1pkwA=; h=From:To:Cc:Subject:Date:From; b=sUl58mLkaTR9oMjcm37ZWZil8KHcEut+fwVOqvCsxf1KIZvwmchsC3jhRYbhoeRMH QWECMUqxpiu7vYySxroV32GhRv4sD5uaftM/mv8qMPw0Hum0Dyoih+q/oWYB9sw20/ sPtYC8JIq2BiHaQWtfkis/euSRfTD5Daji81/lFG3K0Y1COtxpkYww8djzZEhVhdnM laYWMTpKoyWyx/KUUTfimKjg5oogULIO9TqKoKpV0cLdGCIJoutzOCSlGpbjmiXlIl Q5WrXp7j6S5oQEhOuv9DP3Tu8oflxVYQe1IDgVrgkZdTy1lvjYD09617icrrdiuqVE WG7kQqpvj3HRw== From: Keith Busch To: linux-kernel@vger.kernel.org Cc: Keith Busch , Jason Gunthorpe , Kees Cook Subject: [PATCH] overflow: improve check_shl_overflow comment Date: Thu, 1 Apr 2021 09:06:29 -0700 Message-Id: <20210401160629.1941787-1-kbusch@kernel.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A 'false' return means the value was safely set, so the comment should say 'true' for when it is not considered safe. Cc: Jason Gunthorpe Cc: Kees Cook Signed-off-by: Keith Busch --- include/linux/overflow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/overflow.h b/include/linux/overflow.h index ef74051d5cfed..0f12345c21fb5 100644 --- a/include/linux/overflow.h +++ b/include/linux/overflow.h @@ -235,7 +235,7 @@ static inline bool __must_check __must_check_overflow(bool overflow) * - 'a << s' sets the sign bit, if any, in '*d'. * * '*d' will hold the results of the attempted shift, but is not - * considered "safe for use" if false is returned. + * considered "safe for use" if true is returned. */ #define check_shl_overflow(a, s, d) __must_check_overflow(({ \ typeof(a) _a = a; \ -- 2.25.4