From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Kees Cook <keescook@chromium.org>
Cc: Joe Perches <joe@perches.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Denis Efremov <efremov@linux.com>,
Julia Lawall <julia.lawall@inria.fr>,
Alex Dewar <alex.dewar90@gmail.com>,
linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org
Subject: Re: [PATCH V3 1/8] sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output
Date: Sat, 3 Oct 2020 15:55:51 +0200 [thread overview]
Message-ID: <20201003135551.GA3187@kroah.com> (raw)
In-Reply-To: <202010021527.DF20CE0@keescook>
On Fri, Oct 02, 2020 at 03:30:30PM -0700, Kees Cook wrote:
> On Wed, Sep 30, 2020 at 09:22:19PM -0700, Joe Perches wrote:
> > On Wed, 2020-09-30 at 21:17 -0700, Kees Cook wrote:
> > > On Wed, Sep 30, 2020 at 01:57:40PM +0200, Greg Kroah-Hartman wrote:
> > > > Kees, and Rafael, I don't know if you saw this proposal from Joe for
> > > > sysfs files, questions below:
> > >
> > > I'm a fan. I think the use of sprintf() in sysfs might have been one of
> > > my earliest complaints about unsafe code patterns in the kernel. ;)
> > []
> > > > > + if (WARN(!buf || offset_in_page(buf),
> > > > > + "invalid sysfs_emit: buf:%p\n", buf))
> >
> > The dump_stack() is also going to emit pointers
> > so I don't see how it does anything but help
> > show where the buffer was. It is hashed...
>
> dump_stack() is going to report symbols and register contents.
>
> I was just pointing out that %p has no value here[1]. The interesting
> states are: "was it NULL?" "how offset was it?". Its actual content
> won't matter.
Ok, suggestions for a better error message are always welcome :)
thanks,
greg k-h
next prev parent reply other threads:[~2020-10-03 13:55 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 20:40 [PATCH V3 0/8] sysfs: drivers core: Add and use sysfs_emit and sysfs_emit_at Joe Perches
2020-09-16 20:40 ` [PATCH V3 1/8] sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output Joe Perches
2020-09-30 11:57 ` Greg Kroah-Hartman
2020-09-30 13:58 ` Joe Perches
2020-10-02 11:25 ` Greg Kroah-Hartman
2020-10-01 4:17 ` Kees Cook
2020-10-01 4:22 ` Joe Perches
2020-10-02 22:30 ` Kees Cook
2020-10-03 13:55 ` Greg Kroah-Hartman [this message]
2020-10-03 14:59 ` Joe Perches
2020-10-03 22:15 ` Kees Cook
2020-10-01 20:50 ` Greg Kroah-Hartman
2020-10-02 22:27 ` Kees Cook
2020-09-16 20:40 ` [PATCH V3 2/8] drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions Joe Perches
2020-09-16 20:40 ` [PATCH V3 3/8] drivers core: Remove strcat uses around sysfs_emit and neaten Joe Perches
2020-09-16 20:40 ` [PATCH V3 4/8] drivers core: Reindent a couple uses around sysfs_emit Joe Perches
2020-09-16 20:40 ` [PATCH V3 5/8] drivers core: Miscellaneous changes for sysfs_emit Joe Perches
2020-09-16 20:40 ` [PATCH V3 6/8] mm: and drivers core: Convert hugetlb_report_node_meminfo to sysfs_emit Joe Perches
2020-09-18 20:29 ` Mike Kravetz
2020-09-19 6:22 ` Greg Kroah-Hartman
2020-09-19 16:51 ` Joe Perches
2020-09-25 18:32 ` Joe Perches
2020-09-29 0:53 ` Joe Perches
2020-09-29 4:17 ` Greg Kroah-Hartman
2020-09-16 20:40 ` [PATCH V3 7/8] drivers core: Use sysfs_emit for shared_cpu_map_show and shared_cpu_list_show Joe Perches
2020-09-16 20:40 ` [PATCH V3 8/8] drivers core: node: Use a more typical macro definition style for ACCESS_ATTR Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201003135551.GA3187@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=alex.dewar90@gmail.com \
--cc=corbet@lwn.net \
--cc=efremov@linux.com \
--cc=joe@perches.com \
--cc=julia.lawall@inria.fr \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).