All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marksteiner, Stefan" <stefan.marksteiner@joanneum.at>
To: netdev@vger.kernel.org
Subject: Possible bit/byte conversion mistake in xfrm_state.c
Date: Fri, 22 Nov 2013 15:54:01 +0100	[thread overview]
Message-ID: <528F7009.4080303@joanneum.at> (raw)

[-- Attachment #1: Type: text/plain, Size: 860 bytes --]

Hi folks,

I might have found a little bit/byte mistake in xfrm_state.c of 
iproute2-3.11.0 (and also lower versions).

In line 169 the algorithm length is set correctly ("alg->alg_key_len = 
len * 8;") in bits (as it is supposed by /usr/include/linux/xfrm.h, line 
101), but later in line 496 the same value is read and added to a length 
value in bytes ("len += alg.u.alg.alg_key_len;").

I'm not completetly sure, but I'm wondering if this might lead to errors 
for algorithms with big key sizes (>2048 bits)  for the key buffer 
("char buf[RTA_BUF_SIZE]" in line 274)  reserves only 2048 bytes of 
memory (RTA_BUF_SIZE=2048). So taking bits for bytes, the following 
memcopy operation may overwrite adjacent memory areas.

Can somebody verify if this is in fact an issue? Maybe I'm reading this 
whole stuff wrong.

Cheers,

Stefan


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4282 bytes --]

             reply	other threads:[~2013-11-22 15:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22 14:54 Marksteiner, Stefan [this message]
2013-11-24 11:54 ` Possible bit/byte conversion mistake in xfrm_state.c Fan Du

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=528F7009.4080303@joanneum.at \
    --to=stefan.marksteiner@joanneum.at \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.