Re: [PATCH RESEND net] nfc: use GFP_USER for user-controlled kmalloc

2 messages, 2 authors, 2016-01-29 · open the first message on its own page

Re: [PATCH RESEND net] nfc: use GFP_USER for user-controlled kmalloc

From: Eric Dumazet <hidden>
Date: 2016-01-27 21:05:52

On Wed, 2016-01-27 at 11:50 -0800, Cong Wang wrote:
Hmm? I think nfc_llcp_send_ui_frame() needs to do some fragmention
with this temporary memory, or you are saying msg_iter has some
API available to seek the pointer? Even if so, it doesn't look like
suitable for -stable.
memcpy_from_msg(msg_data, msg, len) will overwrite the msg_data with len
bytes, or return an error.

So prior msg_data content does not matter.

kzalloc() before a memset() or memcpy() sounds defensive programming,
kmalloc() is a bit faster.



--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH RESEND net] nfc: use GFP_USER for user-controlled kmalloc

From: Cong Wang <hidden>
Date: 2016-01-29 18:21:21

On Wed, Jan 27, 2016 at 1:05 PM, Eric Dumazet [off-list ref] wrote:
On Wed, 2016-01-27 at 11:50 -0800, Cong Wang wrote:
quoted
Hmm? I think nfc_llcp_send_ui_frame() needs to do some fragmention
with this temporary memory, or you are saying msg_iter has some
API available to seek the pointer? Even if so, it doesn't look like
suitable for -stable.
memcpy_from_msg(msg_data, msg, len) will overwrite the msg_data with len
bytes, or return an error.

So prior msg_data content does not matter.

kzalloc() before a memset() or memcpy() sounds defensive programming,
kmalloc() is a bit faster.
Oh, you mean s/kzalloc/kmalloc/, I thought you mean s/kzalloc//. ;)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help