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: <20230924044847.GA14276@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Date:   Sat, 23 Sep 2023 21:48:47 -0700
From:   Saurabh Singh Sengar <ssengar@...ux.microsoft.com>
To:     Wei Liu <wei.liu@...nel.org>
Cc:     Greg KH <gregkh@...uxfoundation.org>,
        Nuno Das Neves <nunodasneves@...ux.microsoft.com>,
        linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
        x86@...nel.org, linux-arm-kernel@...ts.infradead.org,
        linux-arch@...r.kernel.org, patches@...ts.linux.dev,
        mikelley@...rosoft.com, kys@...rosoft.com, haiyangz@...rosoft.com,
        decui@...rosoft.com, apais@...ux.microsoft.com,
        Tianyu.Lan@...rosoft.com, mukeshrathor@...rosoft.com,
        stanislav.kinsburskiy@...il.com, jinankjain@...ux.microsoft.com,
        vkuznets@...hat.com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
        will@...nel.org, catalin.marinas@....com
Subject: Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to
 VMMs running on Hyper-V

On Sat, Sep 23, 2023 at 08:58:00PM +0000, Wei Liu wrote:
> Greg, thank you for looking at the code.
> 
> On Sat, Sep 23, 2023 at 09:56:13AM +0200, Greg KH wrote:
> > On Fri, Sep 22, 2023 at 11:38:35AM -0700, Nuno Das Neves wrote:
> > > +static int __init mshv_vtl_init(void)
> > > +{
> > > +	int ret;
> > > +
> > > +	tasklet_init(&msg_dpc, mshv_vtl_sint_on_msg_dpc, 0);
> > > +	init_waitqueue_head(&fd_wait_queue);
> > > +
> > > +	if (mshv_vtl_get_vsm_regs()) {
> > > +		pr_emerg("%s: Unable to get VSM capabilities !!\n", __func__);
> > > +		BUG();
> > > +	}
> > 
> > 
> > So you crash the whole kernel if someone loads this module on a non-mshv
> > system?
> > 
> > That seems quite excessive and hostile :(
> > 
> 
> I agree this can be more lenient. It should be safe to just return an
> error code (ENODEV) and let user space decide the next action.
> 
> Saurabh, let me know what you think.

Thanks for reporting this. I agree, returning an error makes more sense here.
We should do this for both BUG() in this init.

- Saurabh

> 
> Thanks,
> Wei.
> 
> > Or am I somehow reading this incorrectly?
> > 
> > thanks,
> > 
> > greg k-h
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ