mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	Richard Weinberger <richard.weinberger@gmail.com>,
	Ma Ke <make_ruc2021@163.com>
Cc: richard@nod.at, xiangyang3@huawei.com,
	linux-um@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] um: vector: fix return value check in vector_legacy_rx
Date: Fri, 5 Jan 2024 11:23:23 +0000	[thread overview]
Message-ID: <d5859c6e-e924-4413-bff5-7009acd8718f@cambridgegreys.com> (raw)
In-Reply-To: <1c098c26132b60ebebc46a39e8b7827a29e3a166.camel@sipsolutions.net>

On 05/01/2024 08:42, Johannes Berg wrote:
> On Thu, 2024-01-04 at 22:05 +0100, Richard Weinberger wrote:
>> On Fri, Oct 6, 2023 at 2:28 PM Ma Ke <make_ruc2021@163.com> wrote:
>>>
>>> In vector_legacy_rx, to avoid an unexpected result returned by
>>> pskb_trim, we should check the return value of pskb_trim().
>>>
>>> Signed-off-by: Ma Ke <make_ruc2021@163.com>
>>> ---
>>>   arch/um/drivers/vector_kern.c | 3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
>>> index 131b7cb29576..822a8c0cdcc1 100644
>>> --- a/arch/um/drivers/vector_kern.c
>>> +++ b/arch/um/drivers/vector_kern.c
>>> @@ -890,7 +890,8 @@ static int vector_legacy_rx(struct vector_private *vp)
>>>                                          skb->ip_summed = CHECKSUM_UNNECESSARY;
>>>                                  }
>>>                          }
>>> -                       pskb_trim(skb, pkt_len - vp->rx_header_size);
>>> +                       if (pskb_trim(skb, pkt_len - vp->rx_header_size))
>>> +                               return 0;
>>
>> I think this adds a memory leak. Also, can pskb_trim() really fail in
>> this scenario?
>> The function controls skb creation and knows all lengths.
>>
> We had pretty much the exact same discussion in the other patch ...
> 
> https://patchwork.ozlabs.org/project/linux-um/patch/20231007005104.3994678-1-make_ruc2021@163.com/
> 
> 
> No point arguing with people who care about static checkers only, I
> guess. This person here never even came back to respond to the comments,
> my take is they're throwing patches over the wall they didn't think
> about, just to see what sticks.

CV padding, the 2024 way. Accomplishments: submitted 231 patches to the 
linux kernel.

> 
> johannes
> 
> 

-- 
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/


      parent reply	other threads:[~2024-01-05 11:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 12:27 Ma Ke
2024-01-04 21:05 ` Richard Weinberger
2024-01-05  8:42   ` Johannes Berg
2024-01-05  8:52     ` Richard Weinberger
2024-01-05 11:23     ` Anton Ivanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5859c6e-e924-4413-bff5-7009acd8718f@cambridgegreys.com \
    --to=anton.ivanov@cambridgegreys.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=make_ruc2021@163.com \
    --cc=richard.weinberger@gmail.com \
    --cc=richard@nod.at \
    --cc=xiangyang3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®