Skip to content

Commit

Permalink
HBSD: fix jail related DoS, see FreeBSD PR: 196474
Browse files Browse the repository at this point in the history
Add boundary checking against len parameter in vfs_setopt_part(...).

PoC:
jail -m crashme -c ip4=new persist
jls

Reported-by: Thomas Bartelmess <thomas@bartelmess.io>
Signed-off-by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
  • Loading branch information
opntr committed Jan 4, 2015
1 parent 78bfef2 commit c520b81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/kern/vfs_mount.c
Expand Up @@ -1643,7 +1643,7 @@ vfs_setopt_part(struct vfsoptlist *opts, const char *name, void *value, int len)
if (opt->value == NULL)
opt->len = len;
else {
if (opt->len < len)
if (len < 0 || opt->len < len)
return (EINVAL);
opt->len = len;
bcopy(value, opt->value, len);
Expand Down

0 comments on commit c520b81

Please sign in to comment.