From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C459716432 for ; Thu, 8 Jun 2023 16:14:37 +0000 (UTC) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 995AD11A; Thu, 8 Jun 2023 09:14:36 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id E8F236081100; Thu, 8 Jun 2023 18:14:34 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id oqHi80E8qL1V; Thu, 8 Jun 2023 18:14:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 1F8CE605DED7; Thu, 8 Jun 2023 18:14:34 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id tehA2qorFK82; Thu, 8 Jun 2023 18:14:34 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id C30E76081100; Thu, 8 Jun 2023 18:14:33 +0200 (CEST) Date: Thu, 8 Jun 2023 18:14:33 +0200 (CEST) From: Richard Weinberger To: Andy Shevchenko Cc: linux-hardening , netdev , linux-kernel , Kees Cook , Petr Mladek , Steven Rostedt , senozhatsky , Rasmus Villemoes , davem , edumazet , kuba , pabeni , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn?= Roy Baron , Benno Lossin , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend Message-ID: <1744246043.3699439.1686240873455.JavaMail.zimbra@nod.at> In-Reply-To: References: <20230607223755.1610-1-richard@nod.at> <20230607223755.1610-2-richard@nod.at> Subject: Re: [RFC PATCH 1/1] vsprintf: Warn on integer scanning overflows Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: vsprintf: Warn on integer scanning overflows Thread-Index: HtQ8lTrkG2Q6/iouRL6tfcEr+5bePw== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net ----- Urspr=C3=BCngliche Mail ----- > Von: "Andy Shevchenko" >> =09if (prefix_chars < max_chars) { >> =09=09rv =3D _parse_integer_limit(cp, base, &result, max_chars - prefix= _chars); >> +=09=09WARN_ON_ONCE(rv & KSTRTOX_OVERFLOW); >=20 > This seems incorrect. simple_strto*() are okay to overflow. It's by desig= n. Is this design decision also known to all users of scanf functions in the k= ernel? Thanks, //richard