[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202007030818.99013B6@keescook>
Date: Fri, 3 Jul 2020 08:29:43 -0700
From: Kees Cook <keescook@...omium.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Dominik Czarnota <dominik.czarnota@...ilofbits.com>,
stable@...r.kernel.org, Jessica Yu <jeyu@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>,
KP Singh <kpsingh@...omium.org>,
"Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Masami Hiramatsu <mhiramat@...nel.org>,
Jakub Kicinski <kuba@...nel.org>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Dmitry Safonov <0x7f454c46@...il.com>,
Will Deacon <will@...nel.org>,
Alexey Dobriyan <adobriyan@...il.com>,
Marc Zyngier <maz@...nel.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Al Viro <viro@...iv.linux.org.uk>,
Matteo Croce <mcroce@...hat.com>,
Edward Cree <ecree@...arflare.com>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>,
Alexander Lobakin <alobakin@...nk.ru>,
Thomas Richter <tmricht@...ux.ibm.com>,
Ingo Molnar <mingo@...nel.org>, netdev@...r.kernel.org,
bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] module: Refactor section attr into bin attribute
On Fri, Jul 03, 2020 at 08:02:07AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Jul 02, 2020 at 04:26:35PM -0700, Kees Cook wrote:
> > + sattr->battr.size = 3 /* "0x", "\n" */ + (BITS_PER_LONG / 4);
>
> They get a correct "size" value now, nice!
Yeah, though I do have some concerns that switching to a bin attribute
changes the userspace behavior a bit. With seq_file-based "show", we
get a 4096 size, and seeking isn't possible (lseek to non-0 location
will fail). With the raw "read", we get the right size, but lseek()
is allowed (but I've got the "read" handler refuse reads starting from
non-zero). When I reviewed[1] potential readers (elftutils, systemtap,
kmod), they all seem to do normal things (fopen/fscanf/fclose), so I'm
hoping this won't be a problem in practice.
> Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Thanks!
[1] https://codesearch.debian.net/search?q=%2Fsys%2Fmodule.*sections&literal=0
--
Kees Cook
Powered by blists - more mailing lists