In the Linux kernel, the following vulnerability has been resolved:
bcache: revert replacing ISERRORNULL with ISERR again
Commit 028ddcac477b ("bcache: Remove unnecessary NULL point check in node allocations") leads a NULL pointer deference in cachesetflush().
1721 if (!ISERRORNULL(c->root)) 1722 listadd(&c->root->list, &c->btree_cache);
From the above code in cachesetflush(), if previous registration code fails before allocating c->root, it is possible c->root is NULL as what it is initialized. _bchbtreenodealloc() never returns NULL but c->root is possible to be NULL at above line 1721.
This patch replaces ISERR() by ISERRORNULL() to fix this.