lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 07 Oct 2020 11:04:42 -0700
From:   Joe Perches <joe@...ches.com>
To:     Jason Gunthorpe <jgg@...pe.ca>
Cc:     linux-rdma <linux-rdma@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] mm: Use sysfs_emit functions not sprintf

On Wed, 2020-10-07 at 09:53 -0300, Jason Gunthorpe wrote:
> 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

The script to change <foo>_show(struct device *, ...)
function uses of
sprintf to sysfs_emit is attached.

The cocci script is coarse and doesn't find nor change all
the possible variants of the sprintf uses in these functions.

It could be run using:

$ spatch --in-place -sp-file sysfs_emit.cocci drivers/infiniband/

Against next-20201007 it produces:

$ git diff --shortstat drivers/infiniband
 25 files changed, 322 insertions(+), 303 deletions(-)

Because it touches a lot of drivers, the 'cc' list is
pretty large for the diff.

Given the size of the cc list, unless there's a single
acceptable patch, I will not submit individual patches as
I really dislike the back and forth of this sub-maintainer
will but this sub-maintainer will not apply a patch.

Doug Ledford <dledford@...hat.com> (supporter:INFINIBAND SUBSYSTEM)
Jason Gunthorpe <jgg@...pe.ca> (supporter:INFINIBAND SUBSYSTEM)
Selvin Xavier <selvin.xavier@...adcom.com> (supporter:BROADCOM NETXTREME-E ROCE DRIVER)
Devesh Sharma <devesh.sharma@...adcom.com> (supporter:BROADCOM NETXTREME-E ROCE DRIVER)
Somnath Kotur <somnath.kotur@...adcom.com> (supporter:BROADCOM NETXTREME-E ROCE DRIVER)
Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com> (supporter:BROADCOM NETXTREME-E ROCE DRIVER)
Naresh Kumar PBS <nareshkumar.pbs@...adcom.com> (supporter:BROADCOM NETXTREME-E ROCE DRIVER)
Potnuri Bharat Teja <bharat@...lsio.com> (supporter:CXGB4 IWARP RNIC DRIVER (IW_CXGB4))
Mike Marciniszyn <mike.marciniszyn@...el.com> (supporter:HFI1 DRIVER)
Dennis Dalessandro <dennis.dalessandro@...el.com> (supporter:HFI1 DRIVER)
Faisal Latif <faisal.latif@...el.com> (supporter:INTEL RDMA RNIC DRIVER)
Shiraz Saleem <shiraz.saleem@...el.com> (supporter:INTEL RDMA RNIC DRIVER)
Yishai Hadas <yishaih@...dia.com> (supporter:MELLANOX MLX4 IB driver)
Leon Romanovsky <leon@...nel.org> (supporter:MELLANOX MLX5 IB driver)
Michal Kalderon <mkalderon@...vell.com> (supporter:QLOGIC QL4xxx RDMA DRIVER)
Ariel Elior <aelior@...vell.com> (supporter:QLOGIC QL4xxx RDMA DRIVER)
Christian Benvenuti <benve@...co.com> (supporter:CISCO VIC LOW LATENCY NIC DRIVER)
Nelson Escobar <neescoba@...co.com> (supporter:CISCO VIC LOW LATENCY NIC DRIVER)
Parvi Kaustubhi <pkaustub@...co.com> (supporter:CISCO VIC LOW LATENCY NIC DRIVER)
Adit Ranadive <aditr@...are.com> (maintainer:VMWARE PVRDMA DRIVER)
VMware PV-Drivers <pv-drivers@...are.com> (maintainer:VMWARE PVRDMA DRIVER)
Zhu Yanjun <yanjunz@...dia.com> (supporter:SOFT-ROCE DRIVER (rxe))
Danil Kipnis <danil.kipnis@...ud.ionos.com> (maintainer:RTRS TRANSPORT DRIVERS)
Jack Wang <jinpu.wang@...ud.ionos.com> (maintainer:RTRS TRANSPORT DRIVERS)
Bart Van Assche <bvanassche@....org> (supporter:SCSI RDMA PROTOCOL (SRP) INITIATOR)
linux-rdma@...r.kernel.org (open list:INFINIBAND SUBSYSTEM)
linux-kernel@...r.kernel.org (open list)


View attachment "sysfs_emit.cocci" of type "text/plain" (6206 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ