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] [day] [month] [year] [list]
Date:   Tue, 20 Aug 2019 22:26:26 +0000
From:   Ben Wei <benwei@...com>
To:     "Justin.Lee1@...l.com" <Justin.Lee1@...l.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "openbmc@...ts.ozlabs.org" <openbmc@...ts.ozlabs.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "sam@...dozajonas.com" <sam@...dozajonas.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "dkodihal@...ux.vnet.ibm.com" <dkodihal@...ux.vnet.ibm.com>
Subject: RE: [PATCH] net/ncsi: add control packet payload to NC-SI commands
 from netlink

> Hi Ben, 
>
> > Hi Justin, 
> > 
> > > Hi Ben,
> > >
> > > I have similar fix locally with different approach as the command handler may have some expectation for those byes.
> > > We can use NCSI_PKT_CMD_OEM handler as it only copies data based on the payload length.
> > 
> > Great! Yes I was thinking the same, we just need some way to take data payload sent from netlink message and sent it over NC-SI.
> > 
> > >
> > > diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c index 5c3fad8..3b01f65 100644
> > > --- a/net/ncsi/ncsi-cmd.c
> > > +++ b/net/ncsi/ncsi-cmd.c
> > > @@ -309,14 +309,19 @@ static struct ncsi_request *ncsi_alloc_command(struct ncsi_cmd_arg *nca)
> > >  
> > >  int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca)  {
> > > + struct ncsi_cmd_handler *nch = NULL;
> > >         struct ncsi_request *nr;
> > > + unsigned char type;
> > >         struct ethhdr *eh;
> > > -   struct ncsi_cmd_handler *nch = NULL;
> > >         int i, ret;
> > >  
> > > + if (nca->req_flags == NCSI_REQ_FLAG_NETLINK_DRIVEN)
> > > +         type = NCSI_PKT_CMD_OEM;
> > > + else
> > > +         type = nca->type;
> > >         /* Search for the handler */
> > >         for (i = 0; i < ARRAY_SIZE(ncsi_cmd_handlers); i++) {
> > > -           if (ncsi_cmd_handlers[i].type == nca->type) {
> > > +         if (ncsi_cmd_handlers[i].type == type) {
> > >                         if (ncsi_cmd_handlers[i].handler)
> > >                                 nch = &ncsi_cmd_handlers[i];
> > >                         else
> > >
> > 
> > So in this case NCSI_PKT_CMD_OEM would be the default handler for all NC-SI command over netlink  (standard and OEM), correct?
> Yes, that is correct. The handler for NCSI_PKT_CMD_OEM command is generic.
>
> > Should we rename this to something like NCSI_PKT_CMD_GENERIC for clarity perhaps?  Do you plan to upstream this patch?  
> NCSI_PKT_CMD_OEM is a real command type and it is defined by the NC-SI specific. 
> We can add comments to indicate that we use the generic command handler from NCSI_PKT_CMD_OEM command.
>
> Does the change work for you? If so, I will prepare the patch.

Thanks Justin. I verified this change and it works, thanks!

-Ben

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ