Re: [PATCH] Use kzfree in tty buffer management to enforce data sanitization

From: Alan Cox
Date: Sun May 31 2009 - 06:25:53 EST

> >        memset(buf->data, 0, N_TTY_BUF_SIZE);
> >        if (PAGE_SIZE != N_TTY_BUF_SIZE)
> >                kfree(...)
> >        else
> >                free_page(...)
> >
> >
> > but quite frankly, I'm not convinced about these patches at all.
> I wonder why the tty code has that N_TTY_BUF_SIZE special casing in
> the first place? I think we can probably just get rid of it and thus
> we can use kzfree() here if we want to.

Some platforms with very large page sizes override the use of page based
allocators (eg older ARM would go around allocating 32K). The normal path
is 4K or 8K page sized buffers.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at