From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D8963DEFE2 for ; Mon, 4 May 2026 15:09:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777907344; cv=none; b=FESUioXumzQ1FdAXbV8HR/daBIVWtbfe20QejJmvkbgr10GQ70tCVMuFN2fkjV/s7FWUPcKDEhrxhWloUx/pFwZRYRj37tj5XcWYCyFjGIJ+aaXAOwnKwqekgfxLCcoTvupN/yOkdDqVzHK5fyqK7ZdHnj5f4lh5BndRbCnBd0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777907344; c=relaxed/simple; bh=LeBE1x9au5CFwcmv+PXKtWZeP3j9b4T0rSCBHN5rClY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nWPLLjMOdJUaGAXq16/bKHfuDp0V5gedTy8qHdQfNeCHYgQC8xbanLpDrDYbaMwzWwYMwjRKu+M7xY2HboqYTHElDbgi4qCliESjmVuAYxiE+q8VDyCg0M09nMFJBPibovFDf5kAfpDm+cOnap3B4DniZ7iTwnkwhEcBAZ2Wcz4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=XKxgFOn3; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="XKxgFOn3" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-445795cf6f1so2490945f8f.1 for ; Mon, 04 May 2026 08:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777907341; x=1778512141; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CYAIIkwnqM71Ak42lM8+OskCGEI20E39pH9IGAxwQzA=; b=XKxgFOn3hTYB4n0svFet9F20rr8O4Vcx7XqhVA5Jpv3V0TT7B37Y+fvfMTAFgeZcfY YAn4DmsY8E3S7rwoA3KVw7gJsgSp0Klb7hpmsx2UfJypLVX2pZXfM/vymsnRlCW0SyWa uF5MeYTY96D6Q1jx7aT4RsiW0T+hXnRG1CqZdwh4saifXItXijvfRUSa/AjZ+beMhZ03 zV6M0G6d+e2JA6nsLbeOZJMwyMqpb2ME5158Sjr8epQYQomdJEhU2tuEUUPNLHy8IRfv O1NOhKjc+BWWr4JbSYySSMzZmotOqeV2aVTR8zaiK09RdnWCaJqeYsUcWYA+FH+jsYjx 4ptQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777907341; x=1778512141; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CYAIIkwnqM71Ak42lM8+OskCGEI20E39pH9IGAxwQzA=; b=k/0Wch72p41OFC1XbjTV0OD0a6ohAI0B/VXhsCMjEl8fhZvJGJBG7xfLtG4doV6OXs ym1AR/9+fbt9LKDwAoy/qWYkgDQO1cxqDQPHTvCqQUIJRQ+ggE34uryG/FvQx/4Lnmnr krO1Bqa8gMkm8n8tkqZxd33v7tEzV7D+eJsIyIUO0S4W33VlsRiSBIfRUBL29xvAnGQz P7Oi3e0PkDTZG7bVqGuQH5LDPqALPx3pGeGYK6ewx40eNv3F24hf6K2UH9aggYkMICwt PCd16prt2e8ILoVHZORwOPa3nYXbQCFMUNw46f9slIyaG3ShivYUKBqWP6UIHJKDZ38a eq7w== X-Forwarded-Encrypted: i=1; AFNElJ8fcnVRX4Wb8+XevQmPw2wihbGB87NveJRghfKsjFp49VvYUqyxeVtv7cjt0TiO8c1jfBQ8K04CtThOlVU=@vger.kernel.org X-Gm-Message-State: AOJu0Yzc8LdjUAZXhiSeDYpe6yiGpucYVKNlFFKqISw73vlqhrzjUzcu mDxIvO1WG3ZzLlkWjkhvROcRWbxOatC/Pkqv5gkboSwCZ/EH0jDsnfNDE5vbR72fjbg= X-Gm-Gg: AeBDiesE5L0Q0nLoktlBPn5PGeNr4EOkFSfYxCUmVLnaExxfbfT1PRD0Z4Gt29v3g9a byEOufM5XwmD1ctLvk3gH1L/44kzfDXa9v54PmKuNPsC/6dzmqykexVCJFDWZKzooJuIaMeqey7 7BsFfKKjwH4GB5tGhXAGLbB9g+XNAcHtrPHfiwSCvjlFvCCVKBgfU0v4TREVNvp4O5S04+IWK6u gNt0uTOqbb0Dz635cuhJZh12lEjAiJvufra+99on0V4WXMCXLD9EKRwIN96fKrsJMUiTyCyQbo3 jsr4zRlje6kQ8xE9YJJ+uFH7BFwUVb3PPsLPPho2foAWWuGMuA37F3xuU6TClCnrA1J7P2AWUsL OxCIsnPGQIVWwsZxptVPjmGMu7FJ2SPlXb3vHgrmWxtld2v2CaM1zeLjKOSG2OQk5qDaaTkH3TK MAzDVodt9bndN9FxAFScXMtNP1Tu5/qQ8y0N+f X-Received: by 2002:a05:6000:184a:b0:449:9aee:4573 with SMTP id ffacd0b85a97d-44bb4a03358mr18190127f8f.18.1777907341460; Mon, 04 May 2026 08:09:01 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-44a8ea7cf6asm27016209f8f.8.2026.05.04.08.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 08:09:01 -0700 (PDT) Date: Mon, 4 May 2026 17:08:58 +0200 From: Petr Mladek To: "Masami Hiramatsu (Google)" Cc: Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Andrew Morton , David Laight , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 0/2] lib/vsprintf: Fixes size check Message-ID: References: <177452711082.197965.4952719534268072174.stgit@devnote2> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <177452711082.197965.4952719534268072174.stgit@devnote2> On Thu 2026-03-26 21:11:50, Masami Hiramatsu (Google) wrote: > Hi, > > Here is the 6th version of patches to fix vsnprintf(). > > - Fix to limit the size of width and precision. > - Warn if the return size is over INT_MAX. > > Previous version is here; > > https://lore.kernel.org/all/177444525139.185641.12184379647176430297.stgit@devnote2/ > > This version just makes function header and WARN_ONCE() to one line[1/2]. > No functional change. > > Thank you, > > --- > > Masami Hiramatsu (Google) (2): > lib/vsprintf: Fix to check field_width and precision > lib/vsprintf: Limit the returning size to INT_MAX I have finally got back to this series. The last version looks good to me. It is very conservative. For both patches: Reviewed-by: Petr Mladek I am going to queue it via the printk tree... Best Regards, Petr PS: My understanding is that it should be safe to make the precision handling compatible with glibc/POSIX printf() and treat negative values as no given values. Feel free to send this change as a followup fix.