diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-03-07 18:59:06 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-03-07 18:59:06 +0100 |
commit | fcc336b9023e30f32652ba644663d356e00bf66b (patch) | |
tree | 2feb24c90a51a16c34ec77d46d196d682a838f8a /sys/src/9/port/portfns.h | |
parent | 0c705580ab670e94b3a792967b428ad841ce570f (diff) |
kernel: catch address overflow in syssegfree()
the "to" address can overflow in syssegfree() causing wrong
number of pages to be passed to mfreeseg(). with the current
implementation of mfreeseg() however, this doesnt cause any
data corruption but was just freeing an unexpected number of
pages.
this change checks for this condition in syssegfree() and
errors out instead. also mfreeseg() was changed to take
ulong argument for number of pages instead of int to keep
it consistent with other routines that work with page counts.
Diffstat (limited to 'sys/src/9/port/portfns.h')
-rw-r--r-- | sys/src/9/port/portfns.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/9/port/portfns.h b/sys/src/9/port/portfns.h index d1e26d7e0..a93ddd2ab 100644 --- a/sys/src/9/port/portfns.h +++ b/sys/src/9/port/portfns.h @@ -167,7 +167,7 @@ void* mallocalign(ulong, ulong, long, ulong); void mallocsummary(void); Block* mem2bl(uchar*, int); ulong mcountseg(Segment*); -void mfreeseg(Segment*, uintptr, int); +void mfreeseg(Segment*, uintptr, ulong); void microdelay(int); uvlong mk64fract(uvlong, uvlong); void mkqid(Qid*, vlong, ulong, int); |