git: kernel: Remove DIOCGSLICEINFO and DIOCSYNCSLICEINFO ioctls

Aaron LI aly at crater.dragonflybsd.org
Wed Jul 22 07:03:10 PDT 2026


commit 4411524ca1e86faee24620d2e31f90705c40d346
Author: Aaron LI <aly at aaronly.me>
Date:   Wed Jul 22 21:32:27 2026 +0800

    kernel: Remove DIOCGSLICEINFO and DIOCSYNCSLICEINFO ioctls
    
    The DIOCGSLICEINFO ioctl code had a buffer overflow bug.  The ioctl
    declared the parameter to have size of 'struct diskslices', which only
    supported MAX_SLICES (i.e., 16) slices.  When try to use this ioctl on a
    disk with more slices (e.g., a GPT disk that may have 128
    partitions/slices), the bcopy() would overflow the target buffer that
    was prepared by mapped_ioctl().
    
    It's actually not easy to properly fix this bug. However, this ioctl was
    actually unused. In addition, FreeBSD has removed it in 2003 [1]. So
    simply remove it, together with the related DIOCSYNCSLICEINFO.
    
    [1] https://github.com/freebsd/freebsd-src/commit/19f7043db0bba9dd2c333612eff90411339d46de
    
    GitHub-PR: #43
    Reported-by: Nathan Sapwell (jewbird)
    Discussed-with: swildner

Summary of changes:
 sys/kern/subr_diskslice.c | 35 -----------------------------------
 sys/sys/diskslice.h       |  4 ++--
 sys/sys/param.h           |  3 ++-
 3 files changed, 4 insertions(+), 38 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4411524ca1e86faee24620d2e31f90705c40d346


-- 
DragonFly BSD source repository


More information about the Commits mailing list