lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0705292109460.29854@schroedinger.engr.sgi.com>
Date:	Tue, 29 May 2007 21:14:23 -0700 (PDT)
From:	Christoph Lameter <clameter@....com>
To:	Mel Gorman <mel@....ul.ie>
cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	kamezawa.hiroyu@...fujitsu.com
Subject: Re: [PATCH 7/7] Add /proc/sys/vm/compact_node for the explicit
 compaction of a node

On Tue, 29 May 2007, Mel Gorman wrote:

> +	if (nodeid < 0)
> +		return -EINVAL;
> +
> +	pgdat = NODE_DATA(nodeid);
> +	if (!pgdat || pgdat->node_id != nodeid)
> +		return -EINVAL;

You cannot pass an arbitrary number to node data since NODE_DATA may do a 
simple array lookup.

Check for node < nr_node_ids first.

pgdat->node_id != nodeid? Sounds like something you should BUG() on.

IA64's NODE_DATA is

struct ia64_node_data {
        short                   active_cpu_count;
        short                   node;
        struct pglist_data      *pg_data_ptrs[MAX_NUMNODES];
};

/*
 * Given a node id, return a pointer to the pg_data_t for the node.
 *
 * NODE_DATA    - should be used in all code not related to system
 *                initialization. It uses pernode data structures to minimize
 *                offnode memory references. However, these structure are not
 *                present during boot. This macro can be used once cpu_init
 *                completes.
 */
#define NODE_DATA(nid)          (local_node_data->pg_data_ptrs[nid])

x86_64 also does

#define NODE_DATA(nid)          (node_data[nid])

-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ