Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 896340 - sys-fs/e2fsprogs: Enable LFS
Summary: sys-fs/e2fsprogs: Enable LFS
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lfs-tracker
  Show dependency tree
 
Reported: 2023-02-24 18:47 UTC by gwendal grignou
Modified: 2024-06-07 16:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Enable LFS (0001-sys-fs-e2fsprogs-Enable-LFS-option.patch,1.06 KB, patch)
2023-02-24 18:49 UTC, gwendal grignou
Details | Diff
readelf output looking for ABI difference (e2fsprogs_abi.tar.bz2,79.34 KB, application/x-bzip)
2023-02-24 20:14 UTC, gwendal grignou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gwendal grignou 2023-02-24 18:47:21 UTC
LFS is currently disabled with:


`--disable-largefile # need to check effect on ABI`

But when enabled ABI does not change (readelf output coming).

Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-24 18:48:46 UTC
Please try libabigail's abidiff as well for these bugs, if you can.
Comment 2 gwendal grignou 2023-02-24 18:49:28 UTC
Created attachment 854422 [details, diff]
Enable LFS
Comment 3 gwendal grignou 2023-02-24 20:14:13 UTC
Created attachment 854472 [details]
readelf output looking for ABI difference

Check there are no ABI difference:

in /build/kukui/tmp/portage/sys-fs/e2fsprogs-1.47.0:

With (new) and with (old) the patch:
for i in $(find . -name \*so | sort) ; do echo $i ;  readelf -sW $i | c++filt ; done > /tmp/..._compare.txt

Remove index difference and Undefined symbols (we know the libraries will call the 64bit version of mmap or truncate).

cut -c '18-' /tmp/..._compare.txt | grep -v UND > /tmp/..._compare_tr.txt

ext2fs_tdb_reopen and ext2fs_tdb_open_ex smaller, no obvious 64 bit difference.

ext2fs_llseek is smaller: 
ext2_loff_t is already a long long, but now lseek64 is called directly.


tdb_brlock is smaller:
This one is a potential problem:
tdb_brlock() use tdb_off_t (u32) as offset while flock offest is 64bit in 64 bit mode.
Luckily, tdb_brlock is internal access only by global tdb_ functions.
Comment 4 gwendal grignou 2023-02-25 04:04:11 UTC
Reply to #1: abidiff did detect indirect changes:

for i in $(find /usr/local/google/home/gwendal/chromiumos_new/chroot/build/kukui/tmp/portage/sys-fs/e2fsprogs-1.47.0/work/*arm -name \*so) ; do echo $(basename $i) --- ; ./tools/abidiff $i ${i/1.47.0/1.47.0-r1} ; done
libext2fs.so ---
Functions changes summary: 0 Removed, 1 Changed (60 filtered out), 0 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

1 function with some indirect sub-type change:

  [C] 'function errcode_t ext2fs_create_icount(ext2_filsys, int, unsigned int, ext2_icount_t*)' at icount.c:326:1 has some indirect sub-type changes:
    parameter 4 of type 'ext2_icount_t*' has sub-type changes:
      in pointed to type 'typedef ext2_icount_t' at ext2fs.h:588:1:
        underlying type 'ext2_icount*' changed:
          in pointed to type 'struct ext2_icount' at icount.c:50:1:
            type size hasn't changed
            1 data member change:
              type of 'TDB_CONTEXT* tdb' changed:
                in pointed to type 'typedef TDB_CONTEXT' at tdb.h:135:1:
                  underlying type 'struct tdb_context' at tdb.c:229:1 changed:
                    type size changed from 2368 to 2432 (in bits)
                    11 data member changes (1 filtered):
                      type of 'ino_t inode' changed:
                        underlying type 'typedef __ino_t' at types.h:148:1 changed:
                          typedef name changed from __ino_t to __ino64_t at types.h:149:1
                          underlying type 'unsigned long int' changed:
                            entity changed from 'unsigned long int' to compatible type 'typedef __uint64_t' at types.h:48:1
                              type name changed from 'unsigned long int' to 'unsigned long long int'
                              type size changed from 32 to 64 (in bits)
                      'tdb_logging_context log' offset changed from 2016 to 2048 (in bits) (by +32 bits)
                      'unsigned int (TDB_DATA*)* hash_fn' offset changed from 2080 to 2112 (in bits) (by +32 bits)
                      'int open_flags' offset changed from 2112 to 2144 (in bits) (by +32 bits)
                      'unsigned int num_locks' offset changed from 2144 to 2176 (in bits) (by +32 bits)
                      'const tdb_methods* methods' offset changed from 2176 to 2208 (in bits) (by +32 bits)
                      'tdb_transaction* transaction' offset changed from 2208 to 2240 (in bits) (by +32 bits)
                      'int page_size' offset changed from 2240 to 2272 (in bits) (by +32 bits)
                      'int max_dead_records' offset changed from 2272 to 2304 (in bits) (by +32 bits)
                      'bool have_transaction_lock' offset changed from 2304 to 2336 (in bits) (by +32 bits)
                      'tdb_len_t real_map_size' offset changed from 2336 to 2368 (in bits) (by +32 bits)

libcom_err.so ---
libe2p.so ---
Functions changes summary: 0 Removed, 1 Changed, 0 Added function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

1 function with some indirect sub-type change:

  [C] 'function int iterate_on_dir(const char*, int (const char*, dirent*, void*)*, void*)' at iod.c:27:1 has some indirect sub-type changes:
    parameter 2 of type 'int (const char*, dirent*, void*)*' has sub-type changes:
      in pointed to type 'function type int (const char*, dirent*, void*)':
        parameter 2 of type 'dirent*' has sub-type changes:
          in pointed to type 'struct dirent' at dirent.h:22:1:
            type size changed from 2144 to 2240 (in bits)
            5 data member changes:
              type of '__ino_t d_ino' changed:
                typedef name changed from __ino_t to __ino64_t at types.h:149:1
                underlying type 'unsigned long int' changed:
                  entity changed from 'unsigned long int' to compatible type 'typedef __uint64_t' at types.h:48:1
                    type name changed from 'unsigned long int' to 'unsigned long long int'
                    type size changed from 32 to 64 (in bits)
              type of '__off_t d_off' changed:
                typedef name changed from __off_t to __off64_t at types.h:153:1
                underlying type 'long int' changed:
                  entity changed from 'long int' to compatible type 'typedef __int64_t' at types.h:47:1
                    type name changed from 'long int' to 'long long int'
                    type size changed from 32 to 64 (in bits)
              and offset changed from 32 to 64 (in bits) (by +32 bits)
              'unsigned short int d_reclen' offset changed from 64 to 128 (in bits) (by +64 bits)
              'unsigned char d_type' offset changed from 80 to 144 (in bits) (by +64 bits)
              'char d_name[256]' offset changed from 88 to 152 (in bits) (by +64 bits)

libss.so ---
Comment 5 gwendal grignou 2023-02-27 17:49:47 UTC
Looking at the abidiff output, the libext2fs documentation (http://fs.csl.utoronto.ca/~sunk/libext2fs.html) and the include files, LFS is not breaking the ABI:


ext2_icount_t is an opaque structure for the client. It is defined in `lib/ext2fs/ext2fs.h` as

/*
 * ext2_icount_t abstraction
 */
...
typedef struct ext2_icount *ext2_icount_t;

Where ext2_icount is only defined in the .c file `lib/ext2fs/icount.c`.


dirent is defined outside of e2fsprogs, by glibc in `/usr/include/bits/dirent.h`.
Comment 6 gwendal grignou 2023-07-14 22:57:17 UTC

*** This bug has been marked as a duplicate of bug 908892 ***
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-15 07:26:54 UTC
(In reply to gwendal grignou from comment #6)
> 
> *** This bug has been marked as a duplicate of bug 908892 ***

I don't think this is a duplicate, it's just related.
Comment 8 Larry the Git Cow gentoo-dev 2024-06-07 16:27:16 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6788373d9c16f58622351c2ee91e9f4f3d07a7cb

commit 6788373d9c16f58622351c2ee91e9f4f3d07a7cb
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-06-07 16:20:57 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-06-07 16:26:47 +0000

    sys-fs/e2fsprogs: add 1.47.1
    
    Adds libarchive support, see 7e3a4f0a33e9859af2bf44e8e1e278c8b10313cc upstream.
    
    Closes: https://bugs.gentoo.org/908892
    Closes: https://bugs.gentoo.org/916029
    Bug: https://bugs.gentoo.org/896340
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/e2fsprogs/Manifest                |   1 +
 sys-fs/e2fsprogs/e2fsprogs-1.47.1.ebuild | 167 +++++++++++++++++++++++++++++++
 sys-fs/e2fsprogs/metadata.xml            |   1 +
 3 files changed, 169 insertions(+)