Skip to contentSkip to conversation

getxattr: kzalloc/vmalloc mismatch

DISCUSSION Joe Perches 1 participant 1 message Jun 19, 2013

lore
Share & tools
lore
#0 lore raw

It seems the kzalloc could be kmalloc instead.

(it's filled by xattr_getsecurity)

in fs/xattr.c:

static ssize_t
getxattr(struct dentry *d, const char __user *name, void __user *value,
size_t size)
{
[]

	if (size) {
		if (size > XATTR_SIZE_MAX)
			size = XATTR_SIZE_MAX;
		kvalue = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
		if (!kvalue) {
			vvalue = vmalloc(size);
			if (!vvalue)
				return -ENOMEM;
			kvalue = vvalue;
		}
	}