All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix off-by-one in DecodeQ931
@ 2016-07-09 19:26 Toby DiPasquale
  2016-07-11 10:33 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Toby DiPasquale @ 2016-07-09 19:26 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

fix off-by-one in DecodeQ931

This patch corrects an off-by-one error in the DecodeQ931 function in
the nf_conntrack_h323 module. This error could result in reading off
the end of a Q.931 frame.

Signed-off-by: Toby DiPasquale <toby@cbcg.net>

---
 net/netfilter/nf_conntrack_h323_asn1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_conntrack_h323_asn1.c b/net/netfilter/nf_conntrack_h323_asn1.c
index bcd5ed6..89b2e46 100644
--- a/net/netfilter/nf_conntrack_h323_asn1.c
+++ b/net/netfilter/nf_conntrack_h323_asn1.c
@@ -846,9 +846,10 @@ int DecodeQ931(unsigned char *buf, size_t sz, Q931 *q931)
 	sz -= len;
 
 	/* Message Type */
-	if (sz < 1)
+	if (sz < 2)
 		return H323_ERROR_BOUND;
 	q931->MessageType = *p++;
+	sz--;
 	PRINT("MessageType = %02X\n", q931->MessageType);
 	if (*p & 0x80) {
 		p++;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix off-by-one in DecodeQ931
  2016-07-09 19:26 [PATCH] fix off-by-one in DecodeQ931 Toby DiPasquale
@ 2016-07-11 10:33 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2016-07-11 10:33 UTC (permalink / raw)
  To: Toby DiPasquale; +Cc: netfilter-devel

On Wed, Jul 13, 2016 at 02:59:00PM -0400, Toby DiPasquale wrote:
> fix off-by-one in DecodeQ931
> 
> This patch corrects an off-by-one error in the DecodeQ931 function in
> the nf_conntrack_h323 module. This error could result in reading off
> the end of a Q.931 frame.

Applied to nf-next, thanks.

I have fixed the timestamp since your clock doesn't look right as this
was placed way ahead in the future.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix off-by-one in DecodeQ931
  2016-07-03 19:01 Toby DiPasquale
@ 2016-07-05  8:54 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2016-07-05  8:54 UTC (permalink / raw)
  To: Toby DiPasquale; +Cc: netfilter-devel

Hi Tobias,

On Wed, Jul 13, 2016 at 02:59:00PM -0400, Toby DiPasquale wrote:
> ---
>  net/netfilter/nf_conntrack_h323_asn1.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Please add a description to your patch and include your Signed-off-by.

For more info, have a look at:

http://lxr.free-electrons.com/source/Documentation/SubmittingPatches

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] fix off-by-one in DecodeQ931
@ 2016-07-03 19:01 Toby DiPasquale
  2016-07-05  8:54 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Toby DiPasquale @ 2016-07-03 19:01 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

---
 net/netfilter/nf_conntrack_h323_asn1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_conntrack_h323_asn1.c b/net/netfilter/nf_conntrack_h323_asn1.c
index bcd5ed6..89b2e46 100644
--- a/net/netfilter/nf_conntrack_h323_asn1.c
+++ b/net/netfilter/nf_conntrack_h323_asn1.c
@@ -846,9 +846,10 @@ int DecodeQ931(unsigned char *buf, size_t sz, Q931 *q931)
 	sz -= len;
 
 	/* Message Type */
-	if (sz < 1)
+	if (sz < 2)
 		return H323_ERROR_BOUND;
 	q931->MessageType = *p++;
+	sz--;
 	PRINT("MessageType = %02X\n", q931->MessageType);
 	if (*p & 0x80) {
 		p++;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-11 10:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-09 19:26 [PATCH] fix off-by-one in DecodeQ931 Toby DiPasquale
2016-07-11 10:33 ` Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2016-07-03 19:01 Toby DiPasquale
2016-07-05  8:54 ` Pablo Neira Ayuso

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.