Date: Thu, 10 Oct 2019 14:22:40 +0000 (UTC) From: Christopher Lameter <cl@...ux.com> To: Shyam Saini <mayhs11saini@...il.com> cc: linux-mm@...ck.org, kernel-hardening@...ts.openwall.com, Matthew Wilcox <willy@...radead.org>, Kees Cook <keescook@...omium.org> Subject: Re: [PATCH] slab: Redefine ZERO_SIZE_PTR to include ERR_PTR range On Thu, 10 Oct 2019, Shyam Saini wrote: > This will help error related to ERR_PTR stand out better. Maybe make ZERO_SIZE_PTR an ERRNO value instead? Then allow ERR_PTRs to be used instead of ZERO_SIZE_PTRs ERRNO_ZERO_OBJECT or something like that? > */ > -#define ZERO_SIZE_PTR ((void *)16) #define ZERO_SIZE_PTR ((void *)-ERRNO_ZERO_OBJECT) > + > +#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) - 1 >= \ > + (unsigned long)ZERO_SIZE_PTR - 1) And call this something different?
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.