All of lore.kernel.org
 help / color / mirror / Atom feed
From: ben.hutchings@codethink.co.uk (Ben Hutchings)
To: cip-dev@lists.cip-project.org
Subject: [cip-dev] Kernel feature support
Date: Thu, 04 Oct 2018 15:43:55 +0100	[thread overview]
Message-ID: <1538371468.3024.251.camel@codethink.co.uk> (raw)
In-Reply-To: <FAF29B5BFF9BF5439C88554EE7A20506F86B25E4@MHQMBX02.moxa.com>

On Sat, 2018-03-31 at 07:56 +0000, Wes Huang (???) wrote:
> Hi,
> ?
> Sorry for the late reply.
> ?
> Please find attached a Moxa kernel configuration using CIP kernel
> 4.4.

And sorry for this extremely late response.

I will recommend disabling various features.  I recognise that you may
have applications that already require the features, and it may be
impractical to change that.  But you should consider seriously that
they may reduce the long-term security and reliability of those
applications.

Filesystems: I recommend disabling btrfs (CONFIG_BTRFS_FS), ceph
(CONFIG_CEPH_LIB, CONFIG_CEPH_FS), cifs (CONFIG_CIFS_FS), nfs
(CONFIG_NFS_FS, CONFIG_NFSD), ntfs (CONFIG_NTFS_FS), and xfs
(CONFIG_XFS_FS), for the reasons given in
<https://lists.cip-project.org/pipermail/cip-dev/2017-May/000263.html>.
I would add to that list afs (CONFIG_AFS_FS), coda (CONFIG_CODA_FS),
gfs2 (CONFIG_GFS2_FS), ncpfs (CONFIG_NCPFS_FS), and ocfs2
(CONFIG_OCFS2_FS) which have the same issue as the other network
filesystems.

Network protocols: I recommend disabling batman-adv
(CONFIG_BATMAN_ADV), dcb (CONFIG_DCB), hsr (CONFIG_HSR), phonet
(CONFIG_PHONET), sctp (CONFIG_IP_SCTP), for the reasons given in
<https://lists.cip-project.org/pipermail/cip-dev/2017-May/000263.html>.
I would now add to the list dccp (CONFIG_IP_DCCP), which has a poor
security record.

Storage drivers: I recommend disabling dm-cache (CONFIG_DM_CACHE),
dm-switch (CONFIG_DM_SWITCH), MD multipath (CONFIG_MD_MULTIPATH) for
the reasons given in
<https://lists.cip-project.org/pipermail/cip-dev/2017-July/000387.html>.

Network drivers: I recommend disabling USB-attached network drivers
and wireless networking if possible, for the reasons given in
<https://lists.cip-project.org/pipermail/cip-dev/2017-July/000387.html>.

I recommend disabling CONFIG_DEVKMEM and CONFIG_DEVMEM, for the reasons
given in
<https://lists.cip-project.org/pipermail/cip-dev/2017-July/000387.html>.

I recommend enabling the kernel stack protector (either
CONFIG_CC_STACKPROTECTOR_REGULAR or CONFIG_CC_STACKPROTECTOR_STRONG)
and enabling heap address randomisation for user-space by default, by
*disabling* CONFIG_COMPAT_BRK.

I recommend enabling module symbol versioning (CONFIG_MODVERSIONS) in
order to catch mistakes.

Since you have CONFIG_PERF_EVENTS enabled, consider restricting use of
performance events to privileged users.  (This requires a patch that
was not accepted upstream, so unfortunately it's not suitable for CIP
kernel branches.  It's in the Debian and Android kernel sources.)

I recommend disabling obsolete system calls (CONFIG_SYSFS_SYSCALL,
CONFIG_UID16, and CONFIG_USELIB).

You have user namespaces (CONFIG_USER_NS) enabled.  Consider disabling
it or restricting creation of user namespaces to privileged users. 
(This also requires a patch that was not accepted upstream.  It's in
the Debian kernel sources.)

I recommend enabling linked list debug checks (CONFIG_LIST_DEBUG),
which can make it harder to exploit some bugs.

I recommend disabling timer statistics (CONFIG_TIMER_STATS).  This
feature has been removed upstream, so is not maintainable.??Apparently
there are tracepoints that provide similar functionality.?

Ben. 

-- 
Ben Hutchings, Software Developer                ?        Codethink Ltd
https://www.codethink.co.uk/                 Dale House, 35 Dale Street
                                     Manchester, M1 2HF, United Kingdom

  parent reply	other threads:[~2018-10-04 14:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31  7:56 [cip-dev] Kernel feature support Wes Huang (黃淵河)
2018-04-02  3:19 ` Daniel Sangorrin
2018-04-02  5:34   ` Wes Huang (黃淵河)
2018-04-02  5:04 ` Zoran S
2018-04-04 17:48 ` Ben Hutchings
2018-10-04 14:43 ` Ben Hutchings [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-03-09 14:33 Ben Hutchings
2017-03-09 15:25 ` Angelo Compagnucci
2017-03-09 18:55   ` Ben Hutchings
2017-03-10 12:39     ` Ben Hutchings
2017-03-15 16:18 ` Agustin Benito Bethencourt
2017-03-23 16:32   ` Chris Paterson
2017-03-24 13:16     ` Ben Hutchings
2017-03-24  3:39   ` 河合英宏 / KAWAI,HIDEHIRO
2017-03-24 13:17     ` Ben Hutchings
2017-03-27 10:31   ` Gernot Hillier
2017-03-27 11:40     ` Jan Kiszka
2017-03-28  1:28 ` Daniel Sangorrin
2017-04-12 14:25 ` Jan Kiszka
2017-04-13 10:18 ` Masato Minda

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=1538371468.3024.251.camel@codethink.co.uk \
    --to=ben.hutchings@codethink.co.uk \
    --cc=cip-dev@lists.cip-project.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.