autofs: harden ioctl table
authorMatthew Wilcox <willy@infradead.org>
Fri, 16 Oct 2020 03:13:08 +0000 (20:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Oct 2020 18:11:22 +0000 (11:11 -0700)
commit589f6b52682542c1b230c435e1de679755f3332a
tree701c254c643a11e7f2f3dc2b252d4d0902d0cf36
parent50b7d85680086126d7bd91dae81d57d4cb1ab6b7
autofs: harden ioctl table

The table of ioctl functions should be marked const in order to put them
in read-only memory, and we should use array_index_nospec() to avoid
speculation disclosing the contents of kernel memory to userspace.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Ian Kent <raven@themaw.net>
Link: https://lkml.kernel.org/r/20200818122203.GO17456@casper.infradead.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/autofs/dev-ioctl.c