Message ID | 20230610204044.3653-1-demi@invisiblethingslab.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1729119vqr; Sat, 10 Jun 2023 13:43:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63WLhfZ6NN88fbwGRyQ0kswSSS1CI8G41IfLoApoFd7mOdQ1wS7EBcGFw0rN14ssqkITUk X-Received: by 2002:a05:6a20:43a8:b0:114:6669:21f8 with SMTP id i40-20020a056a2043a800b00114666921f8mr4935903pzl.35.1686429814869; Sat, 10 Jun 2023 13:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686429814; cv=none; d=google.com; s=arc-20160816; b=j4CiMz0rCD2W1MN9ihIhtOPYqv6+2A/6uN0zsfkRoC7w8rD2IJwvrXzo/WDwC/Sh2s zXWNPWGjt30Kmi8PX5bNKeUjEKdPn2tGw5KzhAZqatwY4f2k5xhNCPZpE8WFoNLTQIs7 XAujXWkK/DIx4sq9gtVfsHS1bPjuorrGZ87fy0cRWFLzp3uou6pTtsScgoUoxAq1FNX+ ri8YRd6IOqfeYWjs0T6uc2879G6J94MhPLwwnc/SgYgdcKX1ch2D7wmebOPPKciEIUT6 5AC7xvF8Ac3TZFMs46/4lIvj//pBfzoy5l+w8W4V9OWc3bod/oMyAN9biDdFK2QDfWgF WQpQ== 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:feedback-id:dkim-signature :dkim-signature; bh=SKMdRs57+W2fpRqekdSA2J6KDxjMwUiujtGE7TR4ltw=; b=qXZfk5cscMw0V5pHkON5+9zXNkWHbPL5rhBpC8gAsCygK6XvED2trUvFAklE5z9SEP nUrXqUmCTbbn9/cisvvD32rViiTIABjFo7FiS3fvGzRHqYTUmJIYVb+HWUAWnFj0YyjZ 3YkSGlqEQyiR+c+ztIAGsfYAPvV5Y0ZecGQIjWeQCqz/L0Pjfvya/txcCe9jZyuCq4BZ w+fBv/zgopY/LDj5BHwkqcY83mD+N2TErmN2tk0mNPurOUHHYfHMcY7me/TJX0oa+dOR 8xk2Jk37/NvcWKeFflEuEugYKWr/SkjauejiRpzCBkfHwhQWlFf5g06N0DqXRKj0vnDF 0KHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b="iWSZtvr/"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=fXqsplFS; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g23-20020aa796b7000000b006293f8330fcsi797897pfk.322.2023.06.10.13.43.23; Sat, 10 Jun 2023 13:43:34 -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; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b="iWSZtvr/"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=fXqsplFS; 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 S230457AbjFJUk4 (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Sat, 10 Jun 2023 16:40:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjFJUky (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 10 Jun 2023 16:40:54 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 708E226B2; Sat, 10 Jun 2023 13:40:53 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 462AD320005D; Sat, 10 Jun 2023 16:40:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 10 Jun 2023 16:40:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1686429648; x=1686516048; bh=SKMdRs57+W2fpRqekdSA2J6KD xjMwUiujtGE7TR4ltw=; b=iWSZtvr/wOJi0wlhO3pBcPbc+O5csKxNy6ZbBr6/z sQuqXbv5mfP0nj9uydkrJEq4GNZ+AxtBqM/XymTVq27Kdibbg/owykCcv2gYWewB feBmyp1jWsd3nkXfusn5kg4Xcmp7M1BAqpaymmOe0MTJOXGLXXfz8FKTYc7oheOo taQ5XDo0EIWBmHvd2CA6OjrxBqSEmPjU8JyPzREcdXBZZl5R+aMRBDRgAAmSdgEs YyZz/bo/SvXLUYg7leX96R0SxnuazEe6FFgvF0ebzXF7zl0Z76fjkKbKW7H2La7k GR5HBBfHmKEb92JHZAvTA97AUpglt5ii8fyEJMOOyKakw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1686429648; x=1686516048; bh=S KMdRs57+W2fpRqekdSA2J6KDxjMwUiujtGE7TR4ltw=; b=fXqsplFSR3vCtQ1Du ZRvZCdC67ZvOFOo8dxrJS/LitSkCOqrS2Bwb1GD+RXO8dpwBNlP+aizdvyTmHkGA Wwu4ydoBuAEptGbMW9mpArx5tJ6fw3m50wSk0TpwHmjQe5AylLx13Ywah7pBMjm6 sdIuyg1FU6djI3vFdK2FnC9l9FpYyDltVZKzdT13Lcg9Nzp0mtnjIHBIAxDB9wLq vNuZjUyY0GB4WOr+WfZ5UAyajb5FuLWLmDlHpnDUScGqFu6yTw0r5+KW15MJxRNy 49Ns03EpS3wS59qnR3WdZaTF6CTsIM0nMlfTHM1flevecgOkEhQ+XrGUmLBzLskm bt+tg== X-ME-Sender: <xms:0N-EZHE28bKOS_BDZcTjrI9xzTY8_XVqw7j4O_-wIKFwuLGAAqx8vw> <xme:0N-EZEXQv120A19dUqz1BCo0_Wp-KR46xw4aRcXnPaABTL9q13w-B0U0NLyH6d9G7 Q5PUlyuRidk4ZU> X-ME-Received: <xmr:0N-EZJIDxgyleXZnSjojmQp4pbMXm0w9SWoQa05YmDO2t0XIJLFlo0W_MgCMu9VNsDh5W85N3o0> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedutddgudehhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomhepffgvmhhi ucforghrihgvucfqsggvnhhouhhruceouggvmhhisehinhhvihhsihgslhgvthhhihhngh hslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhephfeggfeiiedtieejgedutdekgfet geehheegteekvefhfefgudehtdevleegueegnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepuggvmhhisehinhhvihhsihgslhgvthhhihhnghhs lhgrsgdrtghomh X-ME-Proxy: <xmx:0N-EZFEdAIMpkoYOZPDwOxPXRYu3Efr0FabEfN_gX5zR5xVVxLMW8Q> <xmx:0N-EZNUFU2I3xGNMMpRyUBeepQMk9IMYbTyHo1CiFv708Tb9F1f-rQ> <xmx:0N-EZAN22QtxcPAU5fhgVVgxhOe0k3sL0CyRZpP75dgNKF2jisGtEA> <xmx:0N-EZEMSXPqId6b1xaUr-sV7wuz4AWCS4ZOEVjfCTdWySqPWoVu9yA> Feedback-ID: iac594737:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 Jun 2023 16:40:47 -0400 (EDT) From: Demi Marie Obenour <demi@invisiblethingslab.com> To: Hans de Goede <hdegoede@redhat.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Sakari Ailus <sakari.ailus@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Juergen Gross <jgross@suse.com>, Stefano Stabellini <sstabellini@kernel.org>, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Lee Jones <lee@kernel.org>, Andy Lutomirski <luto@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Vincenzo Frascino <vincenzo.frascino@arm.com>, Petr Mladek <pmladek@suse.com>, Steven Rostedt <rostedt@goodmis.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Demi Marie Obenour <demi@invisiblethingslab.com>, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 0/4] Make sscanf() stricter Date: Sat, 10 Jun 2023 16:40:40 -0400 Message-Id: <20230610204044.3653-1-demi@invisiblethingslab.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768337491378599460?= X-GMAIL-MSGID: =?utf-8?q?1768349829977688462?= |
Series | Make sscanf() stricter | |
Message
Demi Marie Obenour
June 10, 2023, 8:40 p.m. UTC
Roger Pau Monné suggested making xenbus_scanf() stricter instead of using a custom parser. Christoph Hellwig asked why the normal vsscanf() cannot be made stricter. Richard Weinberger mentioned Linus Torvalds’s suggestion of using ! to allow overflow. Changes since v2: - Better commit messages. - Fix a compile error in simple_strtoll() (found by 0day bot). - Fix an uninitialized variable (found by Dan Carpenter). Changes since v1: - Better commit messages. - Use ! to explicitly opt-in to allowing overflow. - Treat overflow as a conversion failure instead of returning ERANGE. - Drop the first patch (removal of simple_strtoll()) as it breaks bcache. - Stop skipping spaces in vsscanf() instead of adding a separate vsscanf_strict() function. Demi Marie Obenour (4): limits.h: add UCHAR_MAX, SCHAR_MAX, and SCHAR_MIN vsscanf(): Integer overflow is a conversion failure vsscanf(): do not skip spaces Reject NUL bytes in xenstore nodes .../hive_isp_css_include/platform_support.h | 1 - drivers/xen/xenbus/xenbus_xs.c | 17 +++- include/linux/limits.h | 1 + include/linux/mfd/wl1273-core.h | 3 - include/vdso/limits.h | 3 + lib/vsprintf.c | 98 +++++++++++++------ 6 files changed, 86 insertions(+), 37 deletions(-)
Comments
On Sat, Jun 10, 2023 at 04:40:40PM -0400, Demi Marie Obenour wrote: > Roger Pau Monné suggested making xenbus_scanf() stricter instead of > using a custom parser. Christoph Hellwig asked why the normal vsscanf() > cannot be made stricter. Richard Weinberger mentioned Linus Torvalds’s > suggestion of using ! to allow overflow. As Rasmus articulated, NAK w.o. test cases being added to all parts where your changes touch.