Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B96E4C10DCE for ; Sun, 15 Mar 2020 08:50:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85BF3206E9 for ; Sun, 15 Mar 2020 08:50:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YDjDEByy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85BF3206E9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AfFwdBBfyiTmgygLk9r8EKhTrY8kqBK0rRh0J/C5nrQ=; b=YDjDEByymwjdkh ET+PiKbc9lQoiTFSUA8MocSpo4UMDmYZjprS6ANUUtzXFt72xHO06uEPYnpbEVzcyrH/8hRX9a4Th fSF/oviXG9d9VnILT5y3bInUFe99i8YorVhmTXveDHbjQrcHOfgGhnB7tEQvyVK82RFmYcK3tp1CK TkAWnaCg5ExvWyN9zFZVLiL/iRZ9qUX5+isVZwCGy7ddBHMF2vI1q1fQdILYtfmjrGMBhOxkDvUTd aZ+t1qezcF1Mxt5Il4a7sAAzzAb42tqA76ymrcVqLoOrsv9RS6MAD+9qqicXOBKAmeAF57XQ+3TGp fLMHsAmytwqhLN7T3Hkw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jDOyN-0001mK-MK; Sun, 15 Mar 2020 08:50:15 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jDOyJ-0001U4-Br for linux-arm-kernel@lists.infradead.org; Sun, 15 Mar 2020 08:50:12 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C477FAEE1; Sun, 15 Mar 2020 08:50:00 +0000 (UTC) Date: Sun, 15 Mar 2020 09:50:00 +0100 Message-ID: From: Takashi Iwai To: Mark Rutland Subject: Re: [PATCH] perf: arm-ccn: Use scnprintf() for avoiding potential buffer overflow In-Reply-To: <20200313174922.GA54224@lakrids.cambridge.arm.com> References: <20200311090555.20232-1-tiwai@suse.de> <20200313174922.GA54224@lakrids.cambridge.arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200315_015011_557524_143825AF X-CRM114-Status: GOOD ( 16.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 13 Mar 2020 18:49:23 +0100, Mark Rutland wrote: > > On Wed, Mar 11, 2020 at 10:05:55AM +0100, Takashi Iwai wrote: > > Since snprintf() returns the would-be-output size instead of the > > actual output size, the succeeding calls may go beyond the given > > buffer limit. Fix it by replacing with scnprintf(). > > The buffer limit is PAGE_SIZE bytes here, so I don't think that we can > practically go beyond the buffer limit in this code where we only print > tens of chacters into the buffer. On any system this runs on, PAGE_SIZE > is at least 4096. Right, please take this rather as a precaution. > I'm happy to make this change as it's generally the right thing to do, > but I do want the commit message to be very clear that this is a > cleanup, and not a fix for a bug in practice. > > Can you please either reword the commit message to that effect, or if > this can occur in practice, explain how? OK, will resubmit with rephrasing. thanks, Takashi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel