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  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]
Date:   Thu, 2 Feb 2017 13:10:04 -0500
From:   "Allen Hubbe" <Allen.Hubbe@...l.com>
To:     "'Serge Semin'" <fancer.lancer@...il.com>, <jdmason@...zu.us>,
        <dave.jiang@...el.com>, <Xiangliang.Yu@....com>
Cc:     <Sergey.Semin@...latforms.ru>, <linux-ntb@...glegroups.com>,
        <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support

From: Serge Semin
> +static void idt_nt_write(struct idt_ntb_dev *ndev,
> +			 const unsigned int reg, const u32 data)
> +{
> +	/*
> +	 * It's obvious bug to request a register exceeding the maximum possible
> +	 * value as well as to have it unaligned.
> +	 */
> +	BUG_ON(reg > IDT_REG_PCI_MAX || !IS_ALIGNED(reg, IDT_REG_ALIGN));

Avoid BUG_ON.  Just warn and do nothing (at least, do nothing destructive) instead of crashing the system.  Here, and throughout the driver.

> +#define to_dev_ndev(ndev) (&((ndev)->ntb.dev))
> +#define to_pci_ndev(ndev) ((ndev)->ntb.pdev)

See Logan's recent patches in "Style fixes: open code obfuscating macros."

Powered by blists - more mailing lists