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 5486AC7EE29 for ; Thu, 8 Jun 2023 16:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230341AbjFHQOh convert rfc822-to-8bit (ORCPT ); Thu, 8 Jun 2023 12:14:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbjFHQOh (ORCPT ); Thu, 8 Jun 2023 12:14:37 -0400 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT 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== Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "Andy Shevchenko" >> if (prefix_chars < max_chars) { >> rv = _parse_integer_limit(cp, base, &result, max_chars - prefix_chars); >> + WARN_ON_ONCE(rv & KSTRTOX_OVERFLOW); > > This seems incorrect. simple_strto*() are okay to overflow. It's by design. Is this design decision also known to all users of scanf functions in the kernel? Thanks, //richard