Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753804AbYLBAKf (ORCPT ); Mon, 1 Dec 2008 19:10:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751529AbYLBAK0 (ORCPT ); Mon, 1 Dec 2008 19:10:26 -0500 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:55277 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751068AbYLBAKZ (ORCPT ); Mon, 1 Dec 2008 19:10:25 -0500 Date: Mon, 01 Dec 2008 16:10:26 -0800 (PST) Message-Id: <20081201.161026.234536822.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? From: David Miller In-Reply-To: References: <49345EE4.3070409@oracle.com> X-Mailer: Mew version 6.1 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1235 Lines: 32 From: Jan Engelhardt 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/