diff options
author | Coly Li <colyli@suse.de> | 2020-10-02 16:27:29 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-10-02 15:27:08 -0700 |
commit | 7b62d31d3f399079e7de7cc43e85d6481170970a (patch) | |
tree | 354f8c205a19bab5c71a16c3398229f4ab34fcf6 /sound/drivers/vx/Makefile | |
parent | c381b07941adc2274ce552daf86c94701c5e265a (diff) |
net: add WARN_ONCE in kernel_sendpage() for improper zero-copy send
If a page sent into kernel_sendpage() is a slab page or it doesn't have
ref_count, this page is improper to send by the zero copy sendpage()
method. Otherwise such page might be unexpected released in network code
path and causes impredictable panic due to kernel memory management data
structure corruption.
This path adds a WARN_ON() on the sending page before sends it into the
concrete zero-copy sendpage() method, if the page is improper for the
zero-copy sendpage() method, a warning message can be observed before
the consequential unpredictable kernel panic.
This patch does not change existing kernel_sendpage() behavior for the
improper page zero-copy send, it just provides hint warning message for
following potential panic due the kernel memory heap corruption.
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Cong Wang <amwang@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'sound/drivers/vx/Makefile')
0 files changed, 0 insertions, 0 deletions