mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
fs_ops: limit xattr value length
This commit is contained in:
parent
18b801f960
commit
56fa90397d
2 changed files with 8 additions and 1 deletions
|
@ -291,6 +291,8 @@ a trailing newline is automatically removed (if one exists).
|
|||
Max file size limit.
|
||||
Defaults to @t{32768}.
|
||||
|
||||
This limit also applies to extended attribute values.
|
||||
|
||||
@item -o no_sandbox
|
||||
Do not enable sandboxing features (@pxref{Sandboxing}).
|
||||
|
||||
|
|
|
@ -2350,7 +2350,11 @@ fs_op_setxattr (
|
|||
size_t val_len,
|
||||
int UNUSED_VAR(flags)
|
||||
) {
|
||||
int status = -ENOATTR;
|
||||
int status = -ERANGE;
|
||||
if (val_len > ctx.file_max) {
|
||||
goto end;
|
||||
}
|
||||
status = -ENOATTR;
|
||||
|
||||
switch (INODE_SUBSYS_TYPE(ino)) {
|
||||
case SUBSYS_TYPE_BOOKMARK:
|
||||
|
@ -2358,6 +2362,7 @@ fs_op_setxattr (
|
|||
break;
|
||||
}
|
||||
|
||||
end:
|
||||
send_reply(err, req, -status);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue