[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.1.10.0812012338270.22349@fbirervta.pbzchgretzou.qr>
Date: Mon, 1 Dec 2008 23:40:18 +0100 (CET)
From: Jan Engelhardt <jengelh@...ozas.de>
To: John Haxby <john.haxby@...cle.com>
cc: Netfilter Development Mailinglist
<netfilter-devel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: sg_set_page not usable for .bss?
On Monday 2008-12-01 23:02, John Haxby wrote:
>>>+ sg_init_table(sg, 2);
>>>+ sg_set_buf(&sg[0], data, n);
>>>+ strcpy(digest_password, sysrq_password);
>>>+ i = strlen(digest_password);
>>>+ sg_set_buf(&sg[1], digest_password, i);
>>
>> Could we directly use sysrq_password instead of copying it to
>> digest_password first?
>
> No :-) Eventually I discovered the reason my code wasn't working
> boils down to the definition of sg_set_buf:
>
> sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf))
>
> which doesn't work for sysrq_password. I don't know why I'll
> double check.
Well, sysrq_password is in the .bss section, where as digest_password
is on the heap due to being kmalloc'ed. Maybe that makes a difference?
Someone more versed with the virtual memory layer might know.
>+static char sysrq_password[64];
>[...]
>+ digest_password = kmalloc(sizeof(sysrq_password), GFP_KERNEL);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists