diff options
author | Alexander Egorenkov <egorenar@linux.ibm.com> | 2024-05-10 11:39:53 +0200 |
---|---|---|
committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2024-05-14 20:21:54 +0200 |
commit | 247576bf624a200b9d4dba6126e760af0d5ebe0e (patch) | |
tree | 548d474186879fd6dc3b278167c3a9841e892727 /Kbuild | |
parent | s390/ipl: Fix size of vmcmd buffers for sending z/VM CP diag X'008' cmds (diff) | |
download | linux-247576bf624a200b9d4dba6126e760af0d5ebe0e.tar.xz linux-247576bf624a200b9d4dba6126e760af0d5ebe0e.zip |
s390/ipl: Do not accept z/VM CP diag X'008' cmds longer than max length
The old implementation of vmcmd sysfs string attributes truncated passed
z/VM CP diagnose X'008' commands which were longer than the max allowed
number of characters but the reported number of written characters was
still equal to the entire length of a given string. This can result in
silent failures of some s390-tools (e.g. dumpconf) which can be very hard
to detect. Therefore, this commit makes a write attempt to a vmcmd sysfs
attribute
* fail with E2BIG error if a given string is longer than the maximum
allowed one
* never destroy the old data in the vmcmd sysfs attribute if the new data
doesn't fit into it entirely
* return the actual number of written characters if it succeeds
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'Kbuild')
0 files changed, 0 insertions, 0 deletions