From: David Miller <davem@davemloft.net>
To: jengelh@medozas.de
Cc: john.haxby@oracle.com, netfilter-devel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: sg_set_page not usable for .bss?
Date: Mon, 01 Dec 2008 16:10:26 -0800 (PST) [thread overview]
Message-ID: <20081201.161026.234536822.davem@davemloft.net> (raw)
In-Reply-To: <alpine.LNX.1.10.0812012338270.22349@fbirervta.pbzchgretzou.qr>
From: Jan Engelhardt <jengelh@medozas.de>
Date: Mon, 1 Dec 2008 23:40:18 +0100 (CET)
>
> 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.
You can't use these interfaces on kernel image addresses.
next prev parent reply other threads:[~2008-12-02 0:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 12:28 [PATCH] More secure SYSRQ for xtables-addons John Haxby
2008-12-01 19:34 ` Jan Engelhardt
2008-12-01 22:02 ` John Haxby
2008-12-01 22:37 ` Jan Engelhardt
2008-12-01 22:40 ` sg_set_page not usable for .bss? Jan Engelhardt
2008-12-02 0:10 ` David Miller [this message]
2008-12-02 0:13 ` Jan Engelhardt
2008-12-02 0:14 ` David Miller
2008-12-02 1:41 ` Jan Engelhardt
2008-12-02 6:55 ` David Miller
2008-12-02 1:39 ` [PATCH] More secure SYSRQ for xtables-addons Patrick McHardy
2008-12-02 1:53 ` Jan Engelhardt
2008-12-02 9:43 ` John Haxby
2008-12-02 17:46 ` John Haxby
2008-12-12 8:38 ` John Haxby
2008-12-13 22:14 ` Jan Engelhardt
2008-12-15 12:09 ` Jan Engelhardt
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=20081201.161026.234536822.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jengelh@medozas.de \
--cc=john.haxby@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netfilter-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).