Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp920588rwd; Thu, 8 Jun 2023 09:25:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6sF2xlkLm5vWtmz4B4+XIf5u281+jkePiqI7zqpzixgUbY23znrnkAcviLq0TwVrWlhLDj X-Received: by 2002:a17:903:11cf:b0:1af:e302:123 with SMTP id q15-20020a17090311cf00b001afe3020123mr3410591plh.3.1686241536772; Thu, 08 Jun 2023 09:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686241536; cv=none; d=google.com; s=arc-20160816; b=fyornRBtJ0trRTFfNXyxlPflz5pdKBycAIpH1eJucKHkITHdULzXhNnNTkUa3FHRJ1 alOMLG+zdUljVSl/Yuwpe2V3G1vJcyYOyGbFr2GstEs59J9LEIOvD/p4Tnjxpe4iYYm2 sDu3LYNJadEp6WSP9N7sLlcYvMSlaq9ayBe//yy5+TJPHbZVwWUmA2TWmG7dxKv8pCkZ MkvPAkp4RYKwdineTRECJLXYvVWn0KY4aUrYI7kOzlgKWYBOV26oNUQN9AHlvSnR7Kvn 7sRTk6zg7ISy0KjslQraCB48PfkSs6TdvN2PtpHoMwrSq4j6DLn+MSEAps93+v0FIiNR KRWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=/6bZqBz9gqXuLz5PYYJNFAag3g+pcPuAfJxszK1iE1s=; b=QEUUuD6X65Yrjgex44GHDtskih1K9yG5SP++yK96vJw6ATJe2XxX/qJBDmSsXjCBfg TYbaoKkspNo137beHDyuMEsHfovJ9BWlJWLdc0Wmvr70Sn1eMSkZYLGIBarWUra3ZMTV r4vBTkaP57uYoXQ1MvUiigeb4yI0ix7m68UqP0U8BAFHSeEO2da8UK15NfKUeUVSUSrr IVUAo4heS9HJKuNhTLOCM+h2FYVCET3Ys/NKVZJn7bPghlj8Nmr2BAb1HWDn0dM19Mkd 2a4c0RGn+g3piPMuuGN1N1xWvddkw2UJ9vC7D8qb0vj4pWYRshDC2l6d+LLPtnwwUAbl avQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a170903124900b001b178baf356si1327767plh.95.2023.06.08.09.25.21; Thu, 08 Jun 2023 09:25:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233419AbjFHQOi convert rfc822-to-8bit (ORCPT + 99 others); Thu, 8 Jun 2023 12:14:38 -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== 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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