[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8387061C-CCD2-4F6E-B5F1-8F18F19E686D@oracle.com>
Date: Tue, 17 Oct 2023 18:23:14 +0000
From: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
To: Simon Horman <horms@...nel.org>
CC: open list <linux-kernel@...r.kernel.org>,
"David S. Miller"
<davem@...emloft.net>,
Liam Howlett <liam.howlett@...cle.com>,
Netdev
<netdev@...r.kernel.org>,
kernel test robot <oliver.sang@...el.com>,
"kuba@...nel.org" <kuba@...nel.org>
Subject: Re: [PATCH v1] Fix NULL pointer dereference in cn_filter()
> On Oct 17, 2023, at 1:02 AM, Simon Horman <horms@...nel.org> wrote:
>
> On Fri, Oct 13, 2023 at 03:56:19PM -0700, Anjali Kulkarni wrote:
>> Check that sk_user_data is not NULL, else return from cn_filter().
>
> Thanks,
>
> I agree that this change seems likely to address the problem at the link
> below. And I also think cn_filter() is a good place to fix this [1].
> But I am wondering if you could add some commentary to the patch
> description, describing under what circumstances this problem can occur.
Thanks for reviewing! Yes, it seems this patch has fixed the issue (as tested by Oliver Sang). I will add some description for when this problem can occur in the next patch revision.
>
> [1] https://urldefense.com/v3/__https://lore.kernel.org/all/20231013120105.GH29570@kernel.org/__;!!ACWV5N9M2RV99hQ!NNsMHaho3lyW2NyoT8Sju1BL78S5pNu5AhtZC76cc1Xb1_psXwfP0lmVtVmTxGRrsQkzClWNS8HriosTMols$
>
>> Fixes: 2aa1f7a1f47c ("connector/cn_proc: Add filtering to fix some bugs")
>> Reported-by: kernel test robot <oliver.sang@...el.com>
>> Closes: https://urldefense.com/v3/__https://lore.kernel.org/oe-lkp/202309201456.84c19e27-oliver.sang@intel.com/__;!!ACWV5N9M2RV99hQ!NNsMHaho3lyW2NyoT8Sju1BL78S5pNu5AhtZC76cc1Xb1_psXwfP0lmVtVmTxGRrsQkzClWNS8HrirVfNms7$
>> Signed-off-by: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
>> ---
>> drivers/connector/cn_proc.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
>> index 05d562e9c8b1..a8e55569e4f5 100644
>> --- a/drivers/connector/cn_proc.c
>> +++ b/drivers/connector/cn_proc.c
>> @@ -54,7 +54,7 @@ static int cn_filter(struct sock *dsk, struct sk_buff *skb, void *data)
>> enum proc_cn_mcast_op mc_op;
>> uintptr_t val;
>>
>> - if (!dsk || !data)
>> + if (!dsk || !data || !dsk->sk_user_data)
>> return 0;
>>
>> ptr = (__u32 *)data;
>> --
>> 2.42.0
>>
Powered by blists - more mailing lists