Projects
Factory:RISC-V:Base
util-linux
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
_service:tar_scm:util-linux.spec
Changed
@@ -3,7 +3,7 @@ Name: util-linux Version: 2.37.2 -Release: 13 +Release: 15 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -59,6 +59,9 @@ Patch6038: backport-llib-pty-session-split-PTY-and-signalfd-setup.patch Patch6039: backport-script-fix-use-of-utempter.patch Patch6040: backport-logger-always-update-header-when-read-from-stdin.patch +Patch6041: backport-libblkid-use-checksum-for-jmicron.patch +Patch6042: backport-libblkid-cleanup-indentation.patch +Patch6043: backport-libblkid-fix-jmicron-checksum-and-LE-to-CPU.patch Patch9000: Add-check-to-resolve-uname26-version-test-failed.patch Patch9001: SKIPPED-no-root-permissions-test.patch @@ -190,6 +193,7 @@ %define _build_arg1__ SUID_LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" DAEMON_CFLAGS="$SUID_CFLAGS" DAEMON_LDFLAGS="$SUID_LDFLAGS" unset LINGUAS || : +# del support enable-raw https://github.com/torvalds/linux/commit/603e4922f1c81fc2ed3a87b4f91a8d3aafc7e093 %configure \ --with-systemdsystemunitdir=%{_unitdir} \ --disable-silent-rules \ @@ -198,7 +202,7 @@ --enable-chfn-chsh \ --enable-usrdir-path \ --enable-write \ - --enable-raw \ + --disable-raw \ --enable-hardlink \ --with-python=3 \ --with-systemd \ @@ -220,7 +224,6 @@ install -d %{buildroot}%{_sysconfdir}/pam.d install -d %{buildroot}{/run/uuidd,/var/lib/libuuid,/var/log} -mv %{buildroot}%{_sbindir}/raw %{buildroot}%{_bindir}/raw install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pam.d/login install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/remote install -m644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/chsh @@ -238,7 +241,6 @@ touch %{buildroot}/var/log/lastlog chmod 0644 %{buildroot}/var/log/lastlog -echo ".so man8/raw.8" > %{buildroot}%{_mandir}/man8/rawdevices.8 echo ".so man8/hwclock.8" > %{buildroot}%{_mandir}/man8/clock.8 %find_lang %name @@ -342,7 +344,7 @@ %{_bindir}/{cal,chrt,col,colcrt,colrm,column,chmem,dmesg,eject,fallocate,fincore,findmnt,choom,uclampset} %{_bindir}/{flock,getopt,hexdump,ionice,ipcmk,ipcrm,ipcs,isosize,kill,last,lastb,logger,hardlink} %{_bindir}/{look,lsblk,lscpu,lsipc,lslocks,lslogins,lsmem,lsns,mcookie,mesg,more,mountpoint} -%{_bindir}/{namei,nsenter,prlimit,raw,rename,renice,rev,script,scriptreplay,setarch,setpriv} +%{_bindir}/{namei,nsenter,prlimit,rename,renice,rev,script,scriptreplay,setarch,setpriv} %{_bindir}/{setsid,setterm,taskset,ul,unshare,utmpdump,uuidgen,uuidparse,wdctl,whereis,scriptlive,irqtop,lsirq} %{_sbindir}/{addpart,agetty,blkdiscard,blkid,blkzone,blockdev,chcpu,ctrlaltdel,delpart,fdisk} %{_sbindir}/{findfs,fsck,fsck.cramfs,fsck.minix,fsfreeze,fstrim,ldattach,losetup,mkfs,mkfs.cramfs} @@ -355,7 +357,7 @@ %{compldir}/{fstrim,getopt,hexdump,ionice,ipcmk,ipcrm,ipcs,isosize,last,ldattach} %{compldir}/{logger,look,losetup,lsblk,lscpu,lsipc,lslocks,lslogins,lsmem,lsns} %{compldir}/{mcookie,mesg,mkfs,mkfs.cramfs,mkfs.minix,mkswap,more,mountpoint} -%{compldir}/{namei,nsenter,partx,pivot_root,prlimit,raw,readprofile,rename,renice} +%{compldir}/{namei,nsenter,partx,pivot_root,prlimit,readprofile,rename,renice} %{compldir}/{resizepart,rev,rfkill,rtcwake,runuser,script,scriptreplay,setarch} %{compldir}/{setpriv,setsid,setterm,su,swaplabel,swapoff,swapon,taskset,ul,unshare} %{compldir}/{utmpdump,uuidgen,uuidparse,wall,wdctl,whereis,wipefs,write,zramctl} @@ -425,11 +427,23 @@ %{_mandir}/man8/{blkdiscard.8*,blkid.8*,blkzone.8*,blockdev.8*,chcpu.8*,chmem.8*,ctrlaltdel.8*,delpart.8*} %{_mandir}/man8/{fdisk.8*,findfs.8*,findmnt.8*,fsck.8*,fsck.cramfs.8*,fsck.minix.8*,fsfreeze.8*,fstrim.8*} %{_mandir}/man8/{isosize.8*,ldattach.8*,losetup.8*,lsblk.8*,lslocks.8*,lsns.8*,mkfs.8*,mkfs.cramfs.8*} -%{_mandir}/man8/{mkfs.minix.8*,mkswap.8*,mount.8*,nologin.8*,partx.8*,pivot_root.8*,raw.8*,rawdevices.8*} +%{_mandir}/man8/{mkfs.minix.8*,mkswap.8*,mount.8*,nologin.8*,partx.8*,pivot_root.8*} %{_mandir}/man8/{readprofile.8*,resizepart.8*,rfkill.8*,rtcwake.8*,setarch.8*,sulogin.8.gz,swaplabel.8*} %{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*} %changelog +* Wed Mar 1 2023 zhangyao <zhangyao108@huawei.com> - 2.37.2-15 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:use checksum for jmicron + +* Tue Jan 31 2023 yangchenguang <yangchenguang@uniontech.com> - 2.37.2-14 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: delete support enable-raw + * Sat Sep 17 2022 zhangyao <zhangyao108@huawei.com> - 2.37.2-13 - Type:bugfix - CVE:NA
View file
_service:tar_scm:backport-libblkid-cleanup-indentation.patch
Added
@@ -0,0 +1,32 @@ +From c7471d8b3d4e796eee8ae041e5cbb55c5619318e Mon Sep 17 00:00:00 2001 +From: Karel Zak <kzak@redhat.com> +Date: Wed, 19 Oct 2022 11:24:30 +0200 +Subject: PATCH libblkid: cleanup indentation + +Signed-off-by: Karel Zak <kzak@redhat.com> +--- + libblkid/src/superblocks/jmicron_raid.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libblkid/src/superblocks/jmicron_raid.c b/libblkid/src/superblocks/jmicron_raid.c +index 9ef8cd3f8..ab2c829f0 100644 +--- a/libblkid/src/superblocks/jmicron_raid.c ++++ b/libblkid/src/superblocks/jmicron_raid.c +@@ -17,10 +17,10 @@ + #include "superblocks.h" + + #define JM_SIGNATURE "JM" +-#define JM_MINOR_VERSION(_x) ((_x)->version & 0xFF) +-#define JM_MAJOR_VERSION(_x) ((_x)->version >> 8) +-#define JM_SPARES 2 +-#define JM_MEMBERS 8 ++#define JM_MINOR_VERSION(_x) ((_x)->version & 0xFF) ++#define JM_MAJOR_VERSION(_x) ((_x)->version >> 8) ++#define JM_SPARES 2 ++#define JM_MEMBERS 8 + + struct jm_metadata { + int8_t signature2; /* 0x0 - 0x01 */ +-- +2.27.0 +
View file
_service:tar_scm:backport-libblkid-fix-jmicron-checksum-and-LE-to-CPU.patch
Added
@@ -0,0 +1,92 @@ +From cb92f0d82ae634e46989d3dae673ae3f542f7dd9 Mon Sep 17 00:00:00 2001 +From: Karel Zak <kzak@redhat.com> +Date: Fri, 21 Oct 2022 18:11:59 +0200 +Subject: PATCH libblkid: fix jmicron checksum and LE to CPU + +- don't cast packed struct to uint16_t pointer, use temporary value +- calculate real count for the loop +- convert all to LE for checksum calculation (jm_to_cpu() ignores fillers) + +Signed-off-by: Karel Zak <kzak@redhat.com> +--- + libblkid/src/superblocks/jmicron_raid.c | 44 ++++++++++++++----------- + 1 file changed, 25 insertions(+), 19 deletions(-) + +diff --git a/libblkid/src/superblocks/jmicron_raid.c b/libblkid/src/superblocks/jmicron_raid.c +index ab2c829f0..580c38533 100644 +--- a/libblkid/src/superblocks/jmicron_raid.c ++++ b/libblkid/src/superblocks/jmicron_raid.c +@@ -55,35 +55,38 @@ static void jm_to_cpu(struct jm_metadata *jm) + { + unsigned int i; + +- le16_to_cpu(jm->version); +- le16_to_cpu(jm->checksum); +- le32_to_cpu(jm->identity); ++ jm->version = le16_to_cpu(jm->version); ++ jm->checksum = le16_to_cpu(jm->checksum); ++ jm->identity = le32_to_cpu(jm->identity); ++ jm->segment.base = le32_to_cpu(jm->segment.base); ++ jm->segment.range = le32_to_cpu(jm->segment.range); ++ jm->segment.range2 = le16_to_cpu(jm->segment.range2); + +- le32_to_cpu(jm->segment.base); +- le32_to_cpu(jm->segment.range); +- le16_to_cpu(jm->segment.range2); +- +- le16_to_cpu(jm->attribute); ++ jm->attribute = le16_to_cpu(jm->attribute); + + for (i = 0; i < JM_SPARES; i++) +- le32_to_cpu(jm->sparei); ++ jm->sparei = le32_to_cpu(jm->sparei); + + for (i = 0; i < JM_MEMBERS; i++) +- le32_to_cpu(jm->memberi); ++ jm->memberi = le32_to_cpu(jm->memberi); + } + +-static int jm_checksum(struct jm_metadata *jm) ++static int jm_checksum(const struct jm_metadata *jm) + { +- size_t count = 64; +- char *buf = (char *) jm; +- uint16_t *p = (uint16_t *) buf, sum = 0; ++ size_t count = sizeof(*jm) / sizeof(uint16_t); ++ uint16_t sum = 0; ++ unsigned char *ptr = (unsigned char *) jm; ++ ++ while (count--) { ++ uint16_t val; + +- assert(count <= sizeof(struct jm_metadata)); ++ memcpy(&val, ptr, sizeof(uint16_t)); ++ sum += le16_to_cpu(val); + +- while (count--) +- sum += *p++; ++ ptr += sizeof(uint16_t); ++ } + +- return !sum || sum == 1; ++ return sum == 0 || sum == 1; + } + + static int probe_jmraid(blkid_probe pr, +@@ -108,9 +111,12 @@ static int probe_jmraid(blkid_probe pr, + if (memcmp(jm->signature, JM_SIGNATURE, sizeof(JM_SIGNATURE) - 1) != 0) + return 1; + ++ if (!jm_checksum(jm)) ++ return 1; ++ + jm_to_cpu(jm); + +- if (!jm_checksum(jm)) ++ if (jm->mode > 5) + return 1; + + if (blkid_probe_sprintf_version(pr, "%u.%u", +-- +2.27.0 +
View file
_service:tar_scm:backport-libblkid-use-checksum-for-jmicron.patch
Added
@@ -0,0 +1,122 @@ +From cf68e2c897a29f8a3a1c8402574bbb49adf5a52a Mon Sep 17 00:00:00 2001 +From: Karel Zak <kzak@redhat.com> +Date: Wed, 19 Oct 2022 11:16:17 +0200 +Subject: PATCH libblkid: use checksum for jmicron + +Addresses: https://github.com/util-linux/util-linux/pull/1843 +Signed-off-by: Karel Zak <kzak@redhat.com> +--- + libblkid/src/superblocks/jmicron_raid.c | 83 ++++++++++++++++++++++--- + 1 file changed, 74 insertions(+), 9 deletions(-) + +diff --git a/libblkid/src/superblocks/jmicron_raid.c b/libblkid/src/superblocks/jmicron_raid.c +index ca7986733..9ef8cd3f8 100644 +--- a/libblkid/src/superblocks/jmicron_raid.c ++++ b/libblkid/src/superblocks/jmicron_raid.c +@@ -16,14 +16,75 @@ + + #include "superblocks.h" + ++#define JM_SIGNATURE "JM" ++#define JM_MINOR_VERSION(_x) ((_x)->version & 0xFF) ++#define JM_MAJOR_VERSION(_x) ((_x)->version >> 8) ++#define JM_SPARES 2 ++#define JM_MEMBERS 8 ++ + struct jm_metadata { +- int8_t signature2; +- uint8_t minor_version; +- uint8_t major_version; +- uint16_t checksum; +-}; ++ int8_t signature2; /* 0x0 - 0x01 */ + +-#define JM_SIGNATURE "JM" ++ uint16_t version; /* 0x03 - 0x04 JMicron version */ ++ ++ uint16_t checksum; /* 0x04 - 0x05 */ ++ uint8_t filler10; ++ ++ uint32_t identity; /* 0x10 - 0x13 */ ++ ++ struct { ++ uint32_t base; /* 0x14 - 0x17 */ ++ uint32_t range; /* 0x18 - 0x1B range */ ++ uint16_t range2; /* 0x1C - 0x1D range2 */ ++ } segment; ++ ++ int8_t name16; /* 0x20 - 0x2F */ ++ ++ uint8_t mode; /* 0x30 RAID level */ ++ uint8_t block; /* 0x31 stride size (2=4K, 3=8K, ...) */ ++ uint16_t attribute; /* 0x32 - 0x33 */ ++ uint8_t filler14; ++ ++ uint32_t spareJM_SPARES; /* 0x38 - 0x3F */ ++ uint32_t memberJM_MEMBERS; /* 0x40 - 0x5F */ ++ ++ uint8_t filler20x20; ++} __attribute__ ((packed)); ++ ++static void jm_to_cpu(struct jm_metadata *jm) ++{ ++ unsigned int i; ++ ++ le16_to_cpu(jm->version); ++ le16_to_cpu(jm->checksum); ++ le32_to_cpu(jm->identity); ++ ++ le32_to_cpu(jm->segment.base); ++ le32_to_cpu(jm->segment.range); ++ le16_to_cpu(jm->segment.range2); ++ ++ le16_to_cpu(jm->attribute); ++ ++ for (i = 0; i < JM_SPARES; i++) ++ le32_to_cpu(jm->sparei); ++ ++ for (i = 0; i < JM_MEMBERS; i++) ++ le32_to_cpu(jm->memberi); ++} ++ ++static int jm_checksum(struct jm_metadata *jm) ++{ ++ size_t count = 64; ++ char *buf = (char *) jm; ++ uint16_t *p = (uint16_t *) buf, sum = 0; ++ ++ assert(count <= sizeof(struct jm_metadata)); ++ ++ while (count--) ++ sum += *p++; ++ ++ return !sum || sum == 1; ++} + + static int probe_jmraid(blkid_probe pr, + const struct blkid_idmag *mag __attribute__((__unused__))) +@@ -46,8 +107,14 @@ static int probe_jmraid(blkid_probe pr, + + if (memcmp(jm->signature, JM_SIGNATURE, sizeof(JM_SIGNATURE) - 1) != 0) + return 1; ++ ++ jm_to_cpu(jm); ++ ++ if (!jm_checksum(jm)) ++ return 1; ++ + if (blkid_probe_sprintf_version(pr, "%u.%u", +- jm->major_version, jm->minor_version) != 0) ++ JM_MAJOR_VERSION(jm), JM_MINOR_VERSION(jm)) != 0) + return 1; + if (blkid_probe_set_magic(pr, off, sizeof(jm->signature), + (unsigned char *) jm->signature)) +@@ -61,5 +128,3 @@ const struct blkid_idinfo jmraid_idinfo = { + .probefunc = probe_jmraid, + .magics = BLKID_NONE_MAGIC + }; +- +- +-- +2.27.0 +
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2