Skip to contentSkip to conversation

ipv4 ipsec

DISCUSSION Edgar E Iglesias 2 participants 6 messages May 31, 2005 – Jun 1, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

Im not sure this is the correct list for ipsec issues, but shouldn't the size check at the bottom of net/ipv4/esp4.c be the other way around (2.6.11)?

static int __init esp4_init(void)

{
        struct xfrm_decap_state decap;

        if (sizeof(struct esp_decap_data)  <
            sizeof(decap.decap_data)) {
                extern void decap_data_too_small(void);

                decap_data_too_small();
        }

decap.decap_data should hold an opaque type for the implementation specific decap state, so I guess it should be the bigger of the two.

Best regards

Signature · 14 lines
        Programmer
        Edgar E Iglesias <[email protected]> 46.46.272.1946

% diff -bu /usr/src/linux-2.6.11-gentoo-r8/net/ipv4/esp4.c esp4.c
--- /usr/src/linux-2.6.11-gentoo-r8/net/ipv4/esp4.c     2005-05-11 10:05:03.000000000 +0200
+++ esp4.c      2005-06-01 00:38:55.000000000 +0200
@@ -480,7 +480,7 @@
 {
        struct xfrm_decap_state decap;
 
-       if (sizeof(struct esp_decap_data)  <
+       if (sizeof(struct esp_decap_data)  >
            sizeof(decap.decap_data)) {
                extern void decap_data_too_small(void);
maintainer
#1 lore raw

From: Edgar E Iglesias <[email protected]>
Date: Wed, 1 Jun 2005 00:47:17 +0200

Quoted 3 lines

Im not sure this is the correct list for ipsec issues, but shouldn't the size check at the bottom of net/ipv4/esp4.c be the other way around (2.6.11)?

You are right, good catch. Luckily the size of esp_decap_data is exactly 20 bytes, so the incorrect test happens to be harmless.

esp4.c 2005-06-01 00:38:55.000000000 +0200

Quoted 2 lines
esp4.c 2005-06-01 00:38:55.000000000 +0200 renamed from usr/src/linux-2.6.11-gentoo-r8/net/ipv4/esp4.c 2005-05-11 10:05:03.000000000 +0200 +0 -0

Please porperly -p1 root your patch so I can apply it, and also please provide a "Signed-off-by: " line for yourself as well.

It may seem pointless for a one-line patch, but I want to get you and others into the habit of submitting patches properly in the future.

#2 lore raw
Quoted 9 lines · David S. Miller

From: Edgar E Iglesias <[email protected]>
Date: Wed, 1 Jun 2005 00:47:17 +0200

Quoted 3 lines

Im not sure this is the correct list for ipsec issues, but shouldn't the size check at the bottom of net/ipv4/esp4.c be the other way around (2.6.11)?

You are right, good catch. Luckily the size of esp_decap_data is exactly 20 bytes, so the incorrect test happens to be harmless.

mostly harmless..
But for gcc ports that create packed structs per default, it is 19 bytes.

Quoted 10 lines

esp4.c 2005-06-01 00:38:55.000000000 +0200

Quoted 3 lines
esp4.c 2005-06-01 00:38:55.000000000 +0200 renamed from usr/src/linux-2.6.11-gentoo-r8/net/ipv4/esp4.c 2005-05-11 10:05:03.000000000 +0200 +0 -0

Please porperly -p1 root your patch so I can apply it, and also please provide a "Signed-off-by: " line for yourself as well.

It may seem pointless for a one-line patch, but I want to get you and others into the habit of submitting patches properly in the future.

oh sorry, I hope I get it right this time :)

Best regards

Signature · 17 lines
        Programmer
        Edgar E Iglesias <[email protected]> 46.46.272.1946

Signed-off-by: Edgar E Iglesias <[email protected]>

---------
% diff -Naur linux-2.6.11-gentoo-r6/net/ipv4/esp4.c  linux-2.6.11-gentoo-r9/net/ipv4/esp4.c
--- linux-2.6.11-gentoo-r6/net/ipv4/esp4.c      2005-04-14 21:39:32.000000000 +0200
+++ linux-2.6.11-gentoo-r9/net/ipv4/esp4.c      2005-06-01 00:38:55.000000000 +0200
@@ -480,7 +480,7 @@
 {
        struct xfrm_decap_state decap;
 
-       if (sizeof(struct esp_decap_data)  <
+       if (sizeof(struct esp_decap_data)  >
            sizeof(decap.decap_data)) {
                extern void decap_data_too_small(void);
maintainer
#3 lore raw

From: Edgar E Iglesias <[email protected]>
Date: Wed, 1 Jun 2005 01:23:40 +0200

Quoted 1 line

oh sorry, I hope I get it right this time :)

Your email client has mangled the tab characters into spaces in the patch, so the patch still will not apply correctly.

Please fix this.

#4 lore raw
Quoted 9 lines · David S. Miller

From: Edgar E Iglesias <[email protected]>
Date: Wed, 1 Jun 2005 01:23:40 +0200

Quoted 1 line

oh sorry, I hope I get it right this time :)

Your email client has mangled the tab characters into spaces in the patch, so the patch still will not apply correctly.

Please fix this.

One more try.. sorry

Best regards

Signature · 17 lines
        Programmer
        Edgar E Iglesias <[email protected]> 46.46.272.1946

Signed-off-by: Edgar E Iglesias <[email protected]>

-----

--- linux-2.6.11-gentoo-r6/net/ipv4/esp4.c	2005-04-14 21:39:32.000000000 +0200
+++ linux-2.6.11-gentoo-r9/net/ipv4/esp4.c	2005-06-01 00:38:55.000000000 +0200
@@ -480,7 +480,7 @@
 {
 	struct xfrm_decap_state decap;
 
-	if (sizeof(struct esp_decap_data)  <
+	if (sizeof(struct esp_decap_data)  >
 	    sizeof(decap.decap_data)) {
 		extern void decap_data_too_small(void);
maintainer
#5 lore raw

From: Edgar E Iglesias <[email protected]>
Date: Wed, 1 Jun 2005 02:02:59 +0200

net/ipv4/esp4.c

Quoted 2 lines
net/ipv4/esp4.c +0 -0

Patch applied, thank you.