mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 17:11:46 +00:00
ptr_ring: disallow lockless __ptr_ring_full
Similar to bcecb4bbf8
("net: ptr_ring: otherwise safe empty checks can
overrun array bounds") a lockless use of __ptr_ring_full might
cause an out of bounds access.
We can fix this, but it's easier to just disallow lockless
__ptr_ring_full for now.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
88fae87327
commit
84328342a7
1 changed files with 4 additions and 3 deletions
|
@ -45,9 +45,10 @@ struct ptr_ring {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Note: callers invoking this in a loop must use a compiler barrier,
|
/* Note: callers invoking this in a loop must use a compiler barrier,
|
||||||
* for example cpu_relax(). If ring is ever resized, callers must hold
|
* for example cpu_relax().
|
||||||
* producer_lock - see e.g. ptr_ring_full. Otherwise, if callers don't hold
|
*
|
||||||
* producer_lock, the next call to __ptr_ring_produce may fail.
|
* NB: this is unlike __ptr_ring_empty in that callers must hold producer_lock:
|
||||||
|
* see e.g. ptr_ring_full.
|
||||||
*/
|
*/
|
||||||
static inline bool __ptr_ring_full(struct ptr_ring *r)
|
static inline bool __ptr_ring_full(struct ptr_ring *r)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue