passing buffer to kernel