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 X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 7E57FC47095 for ; Wed, 7 Oct 2020 12:53:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C230121789 for ; Wed, 7 Oct 2020 12:53:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="dA67AYL8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C230121789 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B58D96B0068; Wed, 7 Oct 2020 08:53:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE0476B006C; Wed, 7 Oct 2020 08:53:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A77F6B006E; Wed, 7 Oct 2020 08:53:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id 6A08B6B0068 for ; Wed, 7 Oct 2020 08:53:33 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id EE04C3629 for ; Wed, 7 Oct 2020 12:53:32 +0000 (UTC) X-FDA: 77345120664.23.eye97_0a00a40271cf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id CE3F237606 for ; Wed, 7 Oct 2020 12:53:32 +0000 (UTC) X-HE-Tag: eye97_0a00a40271cf X-Filterd-Recvd-Size: 4158 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Wed, 7 Oct 2020 12:53:32 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id c2so2453091qkf.10 for ; Wed, 07 Oct 2020 05:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KlA515YbaSqlZ5HdNJAxX67ZQ8wURO94VZx2F3akvw4=; b=dA67AYL8tGOQlFUOvo+QfRF/rl708XyhW4ispHSDIjZUKoGwkNntK7W2xWj9iBaHJ/ x0xkBYLHJjl3a5eqM7H7qoi85DQQsYG/ryEuhELpzixIFzbeD+0b74najSwroNNHv6KQ 8KLYcVfT80YrOBoXHWS4mmVeWM5CyAJB/I+Dd1XYR+SFCOIE9eWrMZFnHZSLOt2h5z6b wdlJ9aIV+yR+uzmrApUfnNMI+ESMAYSyuF6cI6bMj3w2RrNx2b9djiIsffeY07kizVIx UZ3M90hqFaR76BzpxUy3pJtEIdNRElC69aB9VWMbcXpy/NXxCyaLaZuuZp0UdU7jdbsr qSAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KlA515YbaSqlZ5HdNJAxX67ZQ8wURO94VZx2F3akvw4=; b=DCEumSYPT+eCWsKlka7H+AzJgUE7x46GYkhdEzcG9RXUEU/1u+rE+4DgZ+CCRE8uKO mD6YC0Nwg+feH6gsAbjrBM1sXi4gJ2Y3Lpxy76cc1bHj/8vttS4NE6/LvyxSbY+yEjqi xJynYdWjzZ35SpCIlAYLBGrXZx1d+dwGMRIoxfkfqUIQyhhHI5Lus7JTkDwoVSDlsvcW eiCcbNvGjWIeVscKSYtFr/HBpm2hY2p1+hxDriXlPAMpDAlE3O52385DkKypZUiTR/re AwpcJMdc9Xe6fUx4/xRAOnnRKuGvrWie7WkPRn/BNcFZFjiB0s2+9JUw89pvTurYcD2j pTzA== X-Gm-Message-State: AOAM532tvNUFlqmSFOhZWioUx5FzXiXzt8IejN2Fbkz3bQnUn+rVC5jV Xbcz338TmP5ddWJAogP2Zp5jaw== X-Google-Smtp-Source: ABdhPJzv+HysSfOnyOeXJ3JMJvf8YUeslpFrIcXI9E6+9Z0oxuRHxXjv/IG/ZBeSCeIiFaDb8EawUg== X-Received: by 2002:a05:620a:159b:: with SMTP id d27mr2639025qkk.28.1602075211631; Wed, 07 Oct 2020 05:53:31 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id z69sm1370364qkb.7.2020.10.07.05.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 05:53:30 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kQ8wk-000tgl-9U; Wed, 07 Oct 2020 09:53:30 -0300 Date: Wed, 7 Oct 2020 09:53:30 -0300 From: Jason Gunthorpe To: Kees Cook Cc: Joe Perches , Andrew Morton , Mike Kravetz , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , linux-mm@kvack.org, linux-kernel , Greg KH Subject: Re: [PATCH -next] mm: Use sysfs_emit functions not sprintf Message-ID: <20201007125330.GO5177@ziepe.ca> References: <8a0d4fc9a4e372b125249b186689f247312d4387.camel@perches.com> <202010070014.76AA763CE@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010070014.76AA763CE@keescook> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 07, 2020 at 12:16:01AM -0700, Kees Cook wrote: > On Tue, Oct 06, 2020 at 09:28:17AM -0700, Joe Perches wrote: > > Convert the various uses of sprintf/snprintf/scnprintf to > > format sysfs output to sysfs_emit and sysfs_emit_at to make > > clear the output is sysfs related and to avoid any possible > > buffer overrun of the PAGE_SIZE buffer. > > > > Done with cocci scripts and some typing. > > Can you include the cocci script in the commit log? It might be nicer to > split the "manual" changes from the cocci changes, as that makes review > much easier too. > > Regardless, yes, I'm a fan of switching these all around to > sysfs_emit*(). :) Yah, +1, I'd welcome patches for drivers/infiniband as well next cycle Thanks, Jason