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: <51ae44fcae424365a6d78f3597175d77@BY2PR0301MB0711.namprd03.prod.outlook.com>
Date:	Wed, 27 Aug 2014 18:45:55 +0000
From:	KY Srinivasan <kys@...rosoft.com>
To:	Sitsofe Wheeler <sitsofe@...il.com>,
	Dexuan Cui <decui@...rosoft.com>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PANIC, hyperv] BUG: unable to handle kernel paging request at
 ffff880077800004 (hv_ringbuffer_write)



> -----Original Message-----
> From: Sitsofe Wheeler [mailto:sitsofe@...il.com]
> Sent: Wednesday, August 27, 2014 9:19 AM
> To: Dexuan Cui
> Cc: KY Srinivasan; Greg Kroah-Hartman; Haiyang Zhang;
> devel@...uxdriverproject.org; linux-kernel@...r.kernel.org
> Subject: Re: [PANIC, hyperv] BUG: unable to handle kernel paging request at
> ffff880077800004 (hv_ringbuffer_write)
> 
> On Wed, Aug 27, 2014 at 02:14:02PM +0000, Dexuan Cui wrote:
> > > -----Original Message-----
> > > From: Sitsofe Wheeler
> > > Sent: Wednesday, August 27, 2014 20:16 PM
> >
> > > > I'm making a patch for this.
> > Please see the end of the mail for the inline patch and try it.
> > (the patch hasn't been rebased against KY's patchset)
> 
> <snip>
> 
> > BTW, with the patch below, hyperv_fb can work now, BUT,
> > *occasionally*,
> > storvsc_probe() -> ... -> vmbus_open() -> can fail due to
> > HV_STATUS_INVALID_ALIGNMENT...
> 
> I applied your new patch on top of KY's pieces (it applied cleanly) and while it
> doesn't blow up, one warning is printed out and the UP boot seemed to stall
> after input: TPPS/2 message (but pressing ctrl-alt-delete allows the system to
> reboot cleanly).

First let me thank you guys for looking into this issue. Looking at your dmesg, it looked like storvsc probe failed as Dexuan had seen. Since the failure appears to be alignment related, perhaps we could test with allocating a page all the time (and getting rid of the kmalloc). Sitsofe, here is a patch based on Dexuan's patch. If this works, I will probably minimize failure cases by pre-allocating per-cpu pages for this.:

diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index edfc848..0ca0cba 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -217,25 +217,17 @@ int hv_post_message(union hv_connection_id connection_id,
                  enum hv_message_type message_type,
                  void *payload, size_t payload_size)
 {
-       struct aligned_input {
-               u64 alignment8;
-               struct hv_input_post_message msg;
-       };

        struct hv_input_post_message *aligned_msg;
        u16 status;
-       unsigned long addr;

        if (payload_size > HV_MESSAGE_PAYLOAD_BYTE_COUNT)
                return -EMSGSIZE;

-       addr = (unsigned long)kmalloc(sizeof(struct aligned_input), GFP_ATOMIC);
-       if (!addr)
+       aligned_msg = (struct hv_input_post_message *)get_zeroed_page(GFP_ATOMIC);
+       if (!aligned_msg)
                return -ENOMEM;

-       aligned_msg = (struct hv_input_post_message *)
-                       (ALIGN(addr, HV_HYPERCALL_PARAM_ALIGN));
-
        aligned_msg->connectionid = connection_id;
        aligned_msg->message_type = message_type;
        aligned_msg->payload_size = payload_size;
@@ -244,7 +236,7 @@ int hv_post_message(union hv_connection_id connection_id,
        status = do_hypercall(HVCALL_POST_MESSAGE, aligned_msg, NULL)
                & 0xFFFF;

-       kfree((void *)addr);
+       free_page((unsigned long)aligned_msg);

        return status;
 }
--
1.7.4.1

--
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