NetBSD Problem Report #57889

From www@netbsd.org  Mon Jan 29 15:47:57 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0EC2E1A9238
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 29 Jan 2024 15:47:57 +0000 (UTC)
Message-Id: <20240129154755.0D5521A9239@mollari.NetBSD.org>
Date: Mon, 29 Jan 2024 15:47:55 +0000 (UTC)
From: rbranco@suse.de
Reply-To: rbranco@suse.de
To: gnats-bugs@NetBSD.org
Subject: ext2fs: Drop EXT2FS_SYSTEM_FLAGS and make its behaviour the default
X-Send-Pr-Version: www-1.0

>Number:         57889
>Category:       kern
>Synopsis:       ext2fs: Drop EXT2FS_SYSTEM_FLAGS and make its behaviour the default
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 29 15:50:00 +0000 2024
>Last-Modified:  Mon Jan 29 18:30:01 +0000 2024
>Originator:     Ricardo Branco
>Release:        NetBSD 10.0_RC3
>Organization:
>Environment:
>Description:
On Linux, only root can set the immutable & append file flags. NetBSD _should_ stick with those semantics.

The default behaviour allows the user to set the immutable/append flags, which is problematic for at least 2 reasons:

1. The user setting the flag when only root should be allowed.
1. When the user sets those flags, he cannot unset them later when running on Linux, FreeBSD (and perhaps other systems).  Only root.

FreeBSD solved this issue already in 2009:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=122047


>How-To-Repeat:

>Fix:
Drop EXT2FS_SYSTEM_FLAGS altogether and make its behaviour the 

>Audit-Trail:
From: Ricardo Branco <rbranco@suse.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57889: ext2fs: Drop EXT2FS_SYSTEM_FLAGS and make its
 behaviour the default
Date: Mon, 29 Jan 2024 16:51:09 +0100

 Fix:

 https://github.com/NetBSD/src/pull/26

 On 1/29/24 16:50, gnats-admin@netbsd.org wrote:
 > Thank you very much for your problem report.
 > It has the internal identification `kern/57889'.
 > The individual assigned to look at your
 > report is: kern-bug-people.
 >
 >> Category:       kern
 >> Responsible:    kern-bug-people
 >> Synopsis:       ext2fs: Drop EXT2FS_SYSTEM_FLAGS and make its behaviour the default
 >> Arrival-Date:   Mon Jan 29 15:50:00 +0000 2024

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57889 CVS commit: src
Date: Mon, 29 Jan 2024 13:27:17 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Mon Jan 29 18:27:15 UTC 2024

 Modified Files:
 	src/share/man/man4: options.4
 	src/sys/arch/amd64/conf: ALL GENERIC XEN3_DOM0 XEN3_DOMU
 	src/sys/arch/amiga/conf: DRACO GENERIC GENERIC.in INSTALL
 	src/sys/arch/amigappc/conf: GENERIC NULL
 	src/sys/arch/arc/conf: ARCTIC GENERIC M403 MIMORI PICA RPC44
 	src/sys/arch/atari/conf: GENERIC.in
 	src/sys/arch/bebox/conf: GENERIC
 	src/sys/arch/cobalt/conf: GENERIC INSTALL
 	src/sys/arch/dreamcast/conf: G1IDE GENERIC
 	src/sys/arch/epoc32/conf: GENERIC
 	src/sys/arch/evbarm/conf: ARMADILLO210 ARMADILLO9 CUBOX GENERIC.common
 	    GUMSTIX HDL_G HPT5325 IYONIX MARVELL_NAS MMNET_GENERIC
 	    MPCSA_GENERIC MV2120 OPENBLOCKS_A6 SHEEVAPLUG
 	src/sys/arch/evbmips/conf: ADM5120 ADM5120-NB ADM5120-USB ALCHEMY AP30
 	    CI20 CPMBR1400 DB120 LINKITSMART7688 MALTA MERAKI MIPSSIM OCTEON
 	    RB153 RB433UAH SBMIPS WGT624V3 XLSATX ZYXELKX
 	src/sys/arch/evbppc/conf: DHT EV64260 EXPLORA451 MPC8536DS MPC8548CDS
 	    OPENBLOCKS200 OPENBLOCKS266 OPENBLOCKS600 P2020DS P2020RDB PMPPC
 	    RB800 RB850GX2 TWRP1025 VIRTEX_DFC VIRTEX_GSRD1 VIRTEX_GSRD2 WALNUT
 	src/sys/arch/ews4800mips/conf: GENERIC
 	src/sys/arch/hp300/conf: GENERIC INSTALL
 	src/sys/arch/hpcsh/conf: GENERIC
 	src/sys/arch/hppa/conf: GENERIC
 	src/sys/arch/i386/conf: ALL GENERIC GENERIC_PS2TINY GENERIC_TINY
 	    INSTALL_FLOPPY INSTALL_TINY NET4501 XEN3PAE_DOM0 XEN3PAE_DOMU
 	src/sys/arch/ia64/conf: GENERIC GENERIC.SKI
 	src/sys/arch/ibmnws/conf: GENERIC
 	src/sys/arch/iyonix/conf: GENERIC
 	src/sys/arch/landisk/conf: GENERIC
 	src/sys/arch/mac68k/conf: GENERIC
 	src/sys/arch/macppc/conf: GENERIC GENERIC_601 MAMBO POWERMAC_G5
 	    POWERMAC_G5_11_2
 	src/sys/arch/mmeye/conf: GENERIC MMEYE_WLF MMTA MMTAICE MMTAROMNEW
 	src/sys/arch/mvmeppc/conf: GENERIC
 	src/sys/arch/next68k/conf: GENERIC RAMDISK SLAB
 	src/sys/arch/ofppc/conf: GENERIC
 	src/sys/arch/prep/conf: GENERIC INSTALL INSTALL_SMALL
 	src/sys/arch/riscv/conf: GENERIC.common
 	src/sys/arch/rs6000/conf: GENERIC
 	src/sys/arch/sandpoint/conf: GENERIC
 	src/sys/arch/sbmips/conf: GENERIC
 	src/sys/arch/sgimips/conf: GENERIC32_IP12 GENERIC32_IP2x GENERIC32_IP3x
 	src/sys/arch/zaurus/conf: GENERIC
 	src/sys/ufs/ext2fs: ext2fs_vnops.c

 Log Message:
 PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
 file flags, only system ones. Restrict those to the superuser. Before
 the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
 default.


 To generate a diff of this commit:
 cvs rdiff -u -r1.527 -r1.528 src/share/man/man4/options.4
 cvs rdiff -u -r1.183 -r1.184 src/sys/arch/amd64/conf/ALL
 cvs rdiff -u -r1.608 -r1.609 src/sys/arch/amd64/conf/GENERIC
 cvs rdiff -u -r1.201 -r1.202 src/sys/arch/amd64/conf/XEN3_DOM0
 cvs rdiff -u -r1.103 -r1.104 src/sys/arch/amd64/conf/XEN3_DOMU
 cvs rdiff -u -r1.201 -r1.202 src/sys/arch/amiga/conf/DRACO
 cvs rdiff -u -r1.338 -r1.339 src/sys/arch/amiga/conf/GENERIC
 cvs rdiff -u -r1.151 -r1.152 src/sys/arch/amiga/conf/GENERIC.in
 cvs rdiff -u -r1.141 -r1.142 src/sys/arch/amiga/conf/INSTALL
 cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amigappc/conf/GENERIC
 cvs rdiff -u -r1.62 -r1.63 src/sys/arch/amigappc/conf/NULL
 cvs rdiff -u -r1.73 -r1.74 src/sys/arch/arc/conf/ARCTIC
 cvs rdiff -u -r1.203 -r1.204 src/sys/arch/arc/conf/GENERIC
 cvs rdiff -u -r1.69 -r1.70 src/sys/arch/arc/conf/M403
 cvs rdiff -u -r1.76 -r1.77 src/sys/arch/arc/conf/MIMORI
 cvs rdiff -u -r1.86 -r1.87 src/sys/arch/arc/conf/PICA
 cvs rdiff -u -r1.57 -r1.58 src/sys/arch/arc/conf/RPC44
 cvs rdiff -u -r1.125 -r1.126 src/sys/arch/atari/conf/GENERIC.in
 cvs rdiff -u -r1.169 -r1.170 src/sys/arch/bebox/conf/GENERIC
 cvs rdiff -u -r1.173 -r1.174 src/sys/arch/cobalt/conf/GENERIC
 cvs rdiff -u -r1.76 -r1.77 src/sys/arch/cobalt/conf/INSTALL
 cvs rdiff -u -r1.11 -r1.12 src/sys/arch/dreamcast/conf/G1IDE
 cvs rdiff -u -r1.138 -r1.139 src/sys/arch/dreamcast/conf/GENERIC
 cvs rdiff -u -r1.18 -r1.19 src/sys/arch/epoc32/conf/GENERIC
 cvs rdiff -u -r1.48 -r1.49 src/sys/arch/evbarm/conf/ARMADILLO210
 cvs rdiff -u -r1.67 -r1.68 src/sys/arch/evbarm/conf/ARMADILLO9 \
     src/sys/arch/evbarm/conf/HDL_G
 cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/CUBOX
 cvs rdiff -u -r1.51 -r1.52 src/sys/arch/evbarm/conf/GENERIC.common
 cvs rdiff -u -r1.110 -r1.111 src/sys/arch/evbarm/conf/GUMSTIX
 cvs rdiff -u -r1.53 -r1.54 src/sys/arch/evbarm/conf/HPT5325
 cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/IYONIX
 cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/conf/MARVELL_NAS
 cvs rdiff -u -r1.55 -r1.56 src/sys/arch/evbarm/conf/MMNET_GENERIC
 cvs rdiff -u -r1.76 -r1.77 src/sys/arch/evbarm/conf/MPCSA_GENERIC
 cvs rdiff -u -r1.46 -r1.47 src/sys/arch/evbarm/conf/MV2120
 cvs rdiff -u -r1.45 -r1.46 src/sys/arch/evbarm/conf/OPENBLOCKS_A6
 cvs rdiff -u -r1.75 -r1.76 src/sys/arch/evbarm/conf/SHEEVAPLUG
 cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbmips/conf/ADM5120 \
     src/sys/arch/evbmips/conf/ADM5120-USB src/sys/arch/evbmips/conf/CI20 \
     src/sys/arch/evbmips/conf/WGT624V3 src/sys/arch/evbmips/conf/XLSATX
 cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbmips/conf/ADM5120-NB
 cvs rdiff -u -r1.72 -r1.73 src/sys/arch/evbmips/conf/ALCHEMY
 cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbmips/conf/AP30
 cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbmips/conf/CPMBR1400
 cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbmips/conf/DB120 \
     src/sys/arch/evbmips/conf/RB153
 cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbmips/conf/LINKITSMART7688
 cvs rdiff -u -r1.105 -r1.106 src/sys/arch/evbmips/conf/MALTA
 cvs rdiff -u -r1.37 -r1.38 src/sys/arch/evbmips/conf/MERAKI
 cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbmips/conf/MIPSSIM
 cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbmips/conf/OCTEON \
     src/sys/arch/evbmips/conf/SBMIPS
 cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbmips/conf/RB433UAH
 cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbmips/conf/ZYXELKX
 cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbppc/conf/DHT
 cvs rdiff -u -r1.75 -r1.76 src/sys/arch/evbppc/conf/EV64260
 cvs rdiff -u -r1.72 -r1.73 src/sys/arch/evbppc/conf/EXPLORA451
 cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbppc/conf/MPC8536DS
 cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbppc/conf/MPC8548CDS
 cvs rdiff -u -r1.49 -r1.50 src/sys/arch/evbppc/conf/OPENBLOCKS200
 cvs rdiff -u -r1.79 -r1.80 src/sys/arch/evbppc/conf/OPENBLOCKS266
 cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbppc/conf/OPENBLOCKS600 \
     src/sys/arch/evbppc/conf/VIRTEX_GSRD1
 cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbppc/conf/P2020DS \
     src/sys/arch/evbppc/conf/P2020RDB src/sys/arch/evbppc/conf/VIRTEX_GSRD2
 cvs rdiff -u -r1.57 -r1.58 src/sys/arch/evbppc/conf/PMPPC
 cvs rdiff -u -r1.40 -r1.41 src/sys/arch/evbppc/conf/RB800
 cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbppc/conf/RB850GX2
 cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbppc/conf/TWRP1025
 cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbppc/conf/VIRTEX_DFC
 cvs rdiff -u -r1.76 -r1.77 src/sys/arch/evbppc/conf/WALNUT
 cvs rdiff -u -r1.67 -r1.68 src/sys/arch/ews4800mips/conf/GENERIC
 cvs rdiff -u -r1.211 -r1.212 src/sys/arch/hp300/conf/GENERIC
 cvs rdiff -u -r1.70 -r1.71 src/sys/arch/hp300/conf/INSTALL
 cvs rdiff -u -r1.117 -r1.118 src/sys/arch/hpcsh/conf/GENERIC
 cvs rdiff -u -r1.42 -r1.43 src/sys/arch/hppa/conf/GENERIC
 cvs rdiff -u -r1.514 -r1.515 src/sys/arch/i386/conf/ALL
 cvs rdiff -u -r1.1252 -r1.1253 src/sys/arch/i386/conf/GENERIC
 cvs rdiff -u -r1.81 -r1.82 src/sys/arch/i386/conf/GENERIC_PS2TINY
 cvs rdiff -u -r1.171 -r1.172 src/sys/arch/i386/conf/GENERIC_TINY
 cvs rdiff -u -r1.57 -r1.58 src/sys/arch/i386/conf/INSTALL_FLOPPY
 cvs rdiff -u -r1.164 -r1.165 src/sys/arch/i386/conf/INSTALL_TINY
 cvs rdiff -u -r1.105 -r1.106 src/sys/arch/i386/conf/NET4501
 cvs rdiff -u -r1.41 -r1.42 src/sys/arch/i386/conf/XEN3PAE_DOM0
 cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/conf/XEN3PAE_DOMU
 cvs rdiff -u -r1.14 -r1.15 src/sys/arch/ia64/conf/GENERIC
 cvs rdiff -u -r1.21 -r1.22 src/sys/arch/ia64/conf/GENERIC.SKI
 cvs rdiff -u -r1.57 -r1.58 src/sys/arch/ibmnws/conf/GENERIC
 cvs rdiff -u -r1.116 -r1.117 src/sys/arch/iyonix/conf/GENERIC
 cvs rdiff -u -r1.76 -r1.77 src/sys/arch/landisk/conf/GENERIC
 cvs rdiff -u -r1.237 -r1.238 src/sys/arch/mac68k/conf/GENERIC
 cvs rdiff -u -r1.378 -r1.379 src/sys/arch/macppc/conf/GENERIC
 cvs rdiff -u -r1.30 -r1.31 src/sys/arch/macppc/conf/GENERIC_601
 cvs rdiff -u -r1.35 -r1.36 src/sys/arch/macppc/conf/MAMBO
 cvs rdiff -u -r1.56 -r1.57 src/sys/arch/macppc/conf/POWERMAC_G5
 cvs rdiff -u -r1.23 -r1.24 src/sys/arch/macppc/conf/POWERMAC_G5_11_2
 cvs rdiff -u -r1.132 -r1.133 src/sys/arch/mmeye/conf/GENERIC
 cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mmeye/conf/MMEYE_WLF
 cvs rdiff -u -r1.55 -r1.56 src/sys/arch/mmeye/conf/MMTA
 cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mmeye/conf/MMTAICE
 cvs rdiff -u -r1.57 -r1.58 src/sys/arch/mmeye/conf/MMTAROMNEW
 cvs rdiff -u -r1.33 -r1.34 src/sys/arch/mvmeppc/conf/GENERIC
 cvs rdiff -u -r1.162 -r1.163 src/sys/arch/next68k/conf/GENERIC
 cvs rdiff -u -r1.5 -r1.6 src/sys/arch/next68k/conf/RAMDISK
 cvs rdiff -u -r1.63 -r1.64 src/sys/arch/next68k/conf/SLAB
 cvs rdiff -u -r1.179 -r1.180 src/sys/arch/ofppc/conf/GENERIC
 cvs rdiff -u -r1.200 -r1.201 src/sys/arch/prep/conf/GENERIC
 cvs rdiff -u -r1.66 -r1.67 src/sys/arch/prep/conf/INSTALL
 cvs rdiff -u -r1.21 -r1.22 src/sys/arch/prep/conf/INSTALL_SMALL
 cvs rdiff -u -r1.9 -r1.10 src/sys/arch/riscv/conf/GENERIC.common
 cvs rdiff -u -r1.49 -r1.50 src/sys/arch/rs6000/conf/GENERIC
 cvs rdiff -u -r1.111 -r1.112 src/sys/arch/sandpoint/conf/GENERIC
 cvs rdiff -u -r1.114 -r1.115 src/sys/arch/sbmips/conf/GENERIC
 cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sgimips/conf/GENERIC32_IP12
 cvs rdiff -u -r1.124 -r1.125 src/sys/arch/sgimips/conf/GENERIC32_IP2x
 cvs rdiff -u -r1.135 -r1.136 src/sys/arch/sgimips/conf/GENERIC32_IP3x
 cvs rdiff -u -r1.95 -r1.96 src/sys/arch/zaurus/conf/GENERIC
 cvs rdiff -u -r1.138 -r1.139 src/sys/ufs/ext2fs/ext2fs_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.