lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 11 Aug 2019 20:57:19 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     christophe.jaillet@...adoo.fr
Cc:     tglx@...utronix.de, gregkh@...uxfoundation.org,
        colin.king@...onical.com, allison@...utok.net,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] nfc: st-nci: Fix an incorrect skb_buff size in
 'st_nci_i2c_read()'

From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Date: Tue,  6 Aug 2019 16:16:40 +0200

> In 'st_nci_i2c_read()', we allocate a sk_buff with a size of
> ST_NCI_I2C_MIN_SIZE + len.
> 
> However, later on, we first 'skb_reserve()' ST_NCI_I2C_MIN_SIZE bytes, then
> we 'skb_put()' ST_NCI_I2C_MIN_SIZE bytes.
> Finally, if 'len' is not 0, we 'skb_put()' 'len' bytes.
> 
> So we use ST_NCI_I2C_MIN_SIZE*2 + len bytes.
> 
> This is incorrect and should already panic. I guess that it does not occur
> because of extra memory allocated because of some rounding.
> 
> Fix it and allocate enough room for the 'skb_reserve()' and the 'skb_put()'
> calls.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> This patch is LIKELY INCORRECT. So think twice to what is the correct
> solution before applying it.
> Maybe the skb_reserve should be axed or some other sizes are incorrect.
> There seems to be an issue, that's all I can say.

The skb_reserve() should be removed, and the second memcpy() should remove
the " + ST_NCI_I2C_MIN_SIZE".

This SKB just get sent down to ndlc_recv() so the content returned from I2C
should places at skb->data to be processed.

Pretty clear this code was never tested.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ